diff options
author | David Turner <digit@android.com> | 2010-03-29 15:05:47 -0700 |
---|---|---|
committer | Android Code Review <code-review@android.com> | 2010-03-29 15:05:47 -0700 |
commit | 8ab5b02b5f58d9b2f050a98b189284a3d6263d7b (patch) | |
tree | 2f92218f958f60550990b0649011c93bf578b90a /libc | |
parent | 87ae0da81716d61f556b1ee456a6764a1f635e55 (diff) | |
parent | bdc6e3c83f70db35603260d5c1baa8097cb765fe (diff) | |
download | bionic-8ab5b02b5f58d9b2f050a98b189284a3d6263d7b.zip bionic-8ab5b02b5f58d9b2f050a98b189284a3d6263d7b.tar.gz bionic-8ab5b02b5f58d9b2f050a98b189284a3d6263d7b.tar.bz2 |
Merge changes Ibdc6e3c8,I9bcb91a2
* changes:
Correct generic memset implementation
Generic memcpy should define MEMCOPY before including bcopy.c
Diffstat (limited to 'libc')
-rw-r--r-- | libc/string/memcpy.c | 2 | ||||
-rw-r--r-- | libc/string/memset.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/libc/string/memcpy.c b/libc/string/memcpy.c index 4cd4a80..dea78b2 100644 --- a/libc/string/memcpy.c +++ b/libc/string/memcpy.c @@ -25,5 +25,5 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#define MEM_COPY +#define MEMCOPY #include "bcopy.c" diff --git a/libc/string/memset.c b/libc/string/memset.c index ed9cdd7..41dafb2 100644 --- a/libc/string/memset.c +++ b/libc/string/memset.c @@ -34,10 +34,10 @@ void* memset(void* dst, int c, size_t n) char* end = q + n; for (;;) { - if (q < end) break; *q++ = (char) c; - if (q < end) break; *q++ = (char) c; - if (q < end) break; *q++ = (char) c; - if (q < end) break; *q++ = (char) c; + if (q >= end) break; *q++ = (char) c; + if (q >= end) break; *q++ = (char) c; + if (q >= end) break; *q++ = (char) c; + if (q >= end) break; *q++ = (char) c; } return dst; |