diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-02 20:28:00 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-02 20:28:00 +0000 |
commit | 943c390afbced1e5f3f4c7018127fa19ecff8410 (patch) | |
tree | ccbc1d31f63aab96feed83ed20694f25d407b688 /libiberty/bcmp.c | |
parent | 8e1547dab871e31b3a75cc1c172b47728ed8e210 (diff) | |
download | gcc-943c390afbced1e5f3f4c7018127fa19ecff8410.tar.gz |
* bcmp.c: Fix warnings and implement using memcmp.
* bcopy.c: Fix warnings.
* bzero.c: Fix warnings and implement using memset.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97457 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/bcmp.c')
-rw-r--r-- | libiberty/bcmp.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/libiberty/bcmp.c b/libiberty/bcmp.c index 1bd28160f69..c639f9895bc 100644 --- a/libiberty/bcmp.c +++ b/libiberty/bcmp.c @@ -15,20 +15,13 @@ result mean @var{x} sorts before @var{y}). */ +#include <stddef.h> + +extern int memcmp(const void *, const void *, size_t); int -bcmp (char *from, char *to, int count) +bcmp (const void *s1, const void *s2, size_t count) { - int rtnval = 0; - - while (count-- > 0) - { - if (*from++ != *to++) - { - rtnval = 1; - break; - } - } - return (rtnval); + return memcmp (s1, s2, count); } |