diff options
author | rich cannings <richc@google.com> | 2010-08-31 15:48:25 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-08-31 15:48:25 -0700 |
commit | 6e42398dd66d1ec7d84257f78c07dcc7f29a2283 (patch) | |
tree | aef330514edb08232783283562c5c3de393ac907 /libc | |
parent | cc6b18291075a7960ad0d638d2047f41be1297e8 (diff) | |
parent | e44cb1a35c4bf3f30e2b9e3961c57b7ca6fa7849 (diff) | |
download | bionic-6e42398dd66d1ec7d84257f78c07dcc7f29a2283.zip bionic-6e42398dd66d1ec7d84257f78c07dcc7f29a2283.tar.gz bionic-6e42398dd66d1ec7d84257f78c07dcc7f29a2283.tar.bz2 |
Merge "Fix return value." into gingerbread
Diffstat (limited to 'libc')
-rw-r--r-- | libc/string/memccpy.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/libc/string/memccpy.c b/libc/string/memccpy.c index 2689e80..789fde6 100644 --- a/libc/string/memccpy.c +++ b/libc/string/memccpy.c @@ -38,18 +38,9 @@ void *memccpy(void *dst, const void *src, int c, size_t n) for (;;) { if (ch == c || p >= p_end) break; *q++ = ch = *p++; - - if (ch == c || p >= p_end) break; - *q++ = ch = *p++; - - if (ch == c || p >= p_end) break; - *q++ = ch = *p++; - - if (ch == c || p >= p_end) break; - *q++ = ch = *p++; } - if (p >= p_end) + if (p >= p_end && ch != c) return NULL; return q; |