summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2013-07-02 22:35:33 +0200
committerHelge Deller <deller@gmx.de>2013-07-02 22:35:33 +0200
commit223eaf83687399dd436306251118f3630928c6ef (patch)
tree4755d43b820f8b3e95a48a63c8f1daef1ad8a2ef
parent2ff3224e763b3e5c178e1ec9bb23a0fef234cd04 (diff)
downloadpalo-223eaf83687399dd436306251118f3630928c6ef.tar.gz
The IPL boot loader sometimes drops a '\n' at the beginning of strings.
Try to fix this by more correctly implement strchr().
-rw-r--r--ipl/lib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ipl/lib.c b/ipl/lib.c
index 01105e5..7c021c3 100644
--- a/ipl/lib.c
+++ b/ipl/lib.c
@@ -304,9 +304,11 @@ char * strncpy(char * dest,const char *src,size_t count)
*/
char * strchr(const char * s, int c)
{
- for(; *s != (char) c; ++s)
+ while (*s != (char)c) {
if (*s == '\0')
return NULL;
+ ++s;
+ }
return (char *) s;
}
/* $Id: lib.c,v 1.3 2000/07/12 21:20:50 bame Exp $ */