diff options
author | Wilco Dijkstra <wilco.dijkstra@arm.com> | 2023-02-03 12:01:33 +0000 |
---|---|---|
committer | Wilco Dijkstra <wilco.dijkstra@arm.com> | 2023-02-06 16:16:19 +0000 |
commit | 32c7acd46401530fdbd4e98508c9baaa705f8b53 (patch) | |
tree | 000fcd17f9b6ddbc14af397f33963e72a3c9d4bb /iconv | |
parent | d2d3f3720ce627a4fe154d8dd14db716a32bcc6e (diff) | |
download | glibc-32c7acd46401530fdbd4e98508c9baaa705f8b53.zip glibc-32c7acd46401530fdbd4e98508c9baaa705f8b53.tar.gz glibc-32c7acd46401530fdbd4e98508c9baaa705f8b53.tar.bz2 |
Replace rawmemchr (s, '\0') with strchr
Almost all uses of rawmemchr find the end of a string. Since most targets use
a generic implementation, replacing it with strchr is better since that is
optimized by compilers into strlen (s) + s. Also fix the generic rawmemchr
implementation to use a cast to unsigned char in the if statement.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'iconv')
-rw-r--r-- | iconv/gconv_conf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c index 21165a5..a75ac13 100644 --- a/iconv/gconv_conf.c +++ b/iconv/gconv_conf.c @@ -502,8 +502,8 @@ __gconv_read_conf (void) do { const char *from = cp; - const char *to = __rawmemchr (from, '\0') + 1; - cp = __rawmemchr (to, '\0') + 1; + const char *to = strchr (from, '\0') + 1; + cp = strchr (to, '\0') + 1; add_alias2 (from, to, cp); } |