diff options
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/locale/ldpart.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/libc/locale/ldpart.c b/lib/libc/locale/ldpart.c index 3c35e201a4fd..ea7b3886ada8 100644 --- a/lib/libc/locale/ldpart.c +++ b/lib/libc/locale/ldpart.c @@ -153,9 +153,13 @@ split_lines(char *p, const char *plim) { int i; - for (i = 0; p < plim; i++) { - p = strchr(p, '\n'); - *p++ = '\0'; + i = 0; + while (p < plim) { + if (*p == '\n') { + *p = '\0'; + i++; + } + p++; } return (i); } |
