diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2009-11-02 13:15:34 +0100 |
---|---|---|
committer | Andreas Schwab <schwab@redhat.com> | 2009-11-02 13:15:34 +0100 |
commit | 27a4a1d867462f6faeb93bfaf6ced524f428fe39 (patch) | |
tree | 45a884c468d137d12c01f6de44ee356abbd06d46 | |
parent | 587045f460bb324b47dcae7567bf186222538a56 (diff) | |
download | glibc-27a4a1d867462f6faeb93bfaf6ced524f428fe39.tar.gz glibc-27a4a1d867462f6faeb93bfaf6ced524f428fe39.tar.xz glibc-27a4a1d867462f6faeb93bfaf6ced524f428fe39.zip |
Avoid multi-arch strchr in tzdata-update
-rw-r--r-- | fedora/tzdata-update.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/fedora/tzdata-update.c b/fedora/tzdata-update.c index f94f9a2609..988fb55636 100644 --- a/fedora/tzdata-update.c +++ b/fedora/tzdata-update.c @@ -483,6 +483,15 @@ clean_up: INTERNAL_SYSCALL (unlink, err, 1, tempfilename); } +static char * +simple_strchr (const char *s, int c) +{ + for (; *s != (char) c; ++s) + if (*s == '\0') + return NULL; + return (char *) s; +} + int main (int argc, char **argv) { @@ -508,7 +517,7 @@ main (int argc, char **argv) while (*p == ' ' || *p == '\t') p++; if (*p == '"') p++; char *q = p; - while (strchr (" \t\n\"", *p) == NULL) p++; + while (simple_strchr (" \t\n\"", *p) == NULL) p++; const char path[] = "/usr/share/zoneinfo/"; if (p - q >= sizeof (zonename) - sizeof (path)) return 0; @@ -517,7 +526,7 @@ main (int argc, char **argv) break; } } - p = strchr (p, '\n'); + p = simple_strchr (p, '\n'); if (p) p++; } if (*zonename == '\0') |