summaryrefslogtreecommitdiff
path: root/strings/bcmp.c
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-12-17 15:00:14 +0200
committerunknown <monty@hundin.mysql.fi>2001-12-17 15:00:14 +0200
commit9ac3ef31f7ecddb6f37cd0ee175d234420a54c60 (patch)
tree7f95675b3decc36faca63e90ee99ac223133c290 /strings/bcmp.c
parent4f63d8ff642f0501475b0f4d60f94eb7f3a9e005 (diff)
downloadmariadb-git-9ac3ef31f7ecddb6f37cd0ee175d234420a54c60.tar.gz
Portability fixes
include/my_pthread.h: Fix for HPUX mysql-test/mysql-test-run.sh: Wait for socket instead of pid file mysys/my_static.c: Portability fix (for OSF1) mysys/raid.cc: Portability fix (for OSF1) sql/mysqld.cc: Fixed typo for FreeBSD. strings/bcmp.c: Fix for purify
Diffstat (limited to 'strings/bcmp.c')
-rw-r--r--strings/bcmp.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/strings/bcmp.c b/strings/bcmp.c
index 52f545e7b42..7b510258fef 100644
--- a/strings/bcmp.c
+++ b/strings/bcmp.c
@@ -18,12 +18,18 @@
bcmp(s1, s2, len) returns 0 if the "len" bytes starting at "s1" are
identical to the "len" bytes starting at "s2", non-zero if they are
different.
- Now only used with purify.
+ Now only used with purify because purify gives wrong warnings when
+ comparing a shorter string with bcmp.
*/
#include <my_global.h>
#include "m_string.h"
+#ifdef HAVE_purify
+#undef bcmp
+#undef HAVE_BCMP
+#endif
+
#if !defined(bcmp) && !defined(HAVE_BCMP)
#if defined(MC68000) && defined(DS90)
@@ -45,14 +51,7 @@ uint len; /* 0 <= len <= 65535 */
#else
-#ifdef HAVE_purify
-int my_bcmp(s1, s2, len)
-#else
-int bcmp(s1, s2, len)
-#endif
- register const char *s1;
- register const char *s2;
- register uint len;
+int bcmp(register const char *s1,register const char *s2, register uint len)
{
while (len-- != 0 && *s1++ == *s2++) ;
return len+1;