Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157454
b: refs/heads/master
c: 18d00ac
h: refs/heads/master
v: v3
  • Loading branch information
Hendrik Brueckner authored and Martin Schwidefsky committed Sep 11, 2009
1 parent aeb8aaa commit a6e6485
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 684d2fd48e718e70dad21ef7c528649578147e48
refs/heads/master: 18d00acfe2f3fc5ee62f679eb2e397ae962fe69b
13 changes: 11 additions & 2 deletions trunk/arch/s390/kernel/ipl.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,19 +340,28 @@ size_t reipl_append_ascii_scpdata(char *dest, size_t size,
{
size_t count;
size_t i;
int has_lowercase;

count = min(size - 1, scpdata_length(ipb->ipl_info.fcp.scp_data,
ipb->ipl_info.fcp.scp_data_len));
if (!count)
goto out;

for (i = 0; i < count; i++)
has_lowercase = 0;
for (i = 0; i < count; i++) {
if (!isascii(ipb->ipl_info.fcp.scp_data[i])) {
count = 0;
goto out;
}
if (!has_lowercase && islower(ipb->ipl_info.fcp.scp_data[i]))
has_lowercase = 1;
}

memcpy(dest, ipb->ipl_info.fcp.scp_data, count);
if (has_lowercase)
memcpy(dest, ipb->ipl_info.fcp.scp_data, count);
else
for (i = 0; i < count; i++)
dest[i] = tolower(ipb->ipl_info.fcp.scp_data[i]);
out:
dest[count] = '\0';
return count;
Expand Down

0 comments on commit a6e6485

Please sign in to comment.