diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-08-11 18:39:12 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-08-11 18:39:12 -0400 |
commit | 35c16933f03a3db49f3e2048759d850460c8a509 (patch) | |
tree | 21e4b210284277357fc7ea5a39943e849cb87293 /src | |
parent | 617182734ca0beffa347747019d78b972e2038f9 (diff) | |
download | musl-35c16933f03a3db49f3e2048759d850460c8a509.tar.gz musl-35c16933f03a3db49f3e2048759d850460c8a509.tar.bz2 musl-35c16933f03a3db49f3e2048759d850460c8a509.tar.xz musl-35c16933f03a3db49f3e2048759d850460c8a509.zip |
remove buggy short-string wcsstr implementation; always use twoway
since this interface is rarely used, it's probably best to lean
towards keeping code size down anyway. one-character needles will
still be found immediately by the initial wcschr call anyway.
Diffstat (limited to 'src')
-rw-r--r-- | src/string/wcsstr.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/string/wcsstr.c b/src/string/wcsstr.c index 966174f8..fc4bacec 100644 --- a/src/string/wcsstr.c +++ b/src/string/wcsstr.c @@ -3,14 +3,6 @@ #include <stdlib.h> #include <stdint.h> -static wchar_t *naive_wcsstr(const wchar_t *h, const wchar_t *n) -{ - size_t i; - for (i=0; n[i] && h[i]; i++) - for ( ; n[i] != h[i]; h++, i=0); - return n[i] ? 0 : (wchar_t *)h; -} - #define MAX(a,b) ((a)>(b)?(a):(b)) #define MIN(a,b) ((a)<(b)?(a):(b)) @@ -111,7 +103,6 @@ wchar_t *wcsstr(const wchar_t *h, const wchar_t *n) h = wcschr(h, *n); if (!h || !n[1]) return (wchar_t *)h; if (!h[1]) return 0; - if (!n[2] || !n[3] || !n[4]) return naive_wcsstr(h, n); return twoway_wcsstr(h, n); } |