Skip to content

Commit

Permalink
bcmp(3) tries to return length, which is a size_t, as an int.
Browse files Browse the repository at this point in the history
Instead, just return 1 if there is a difference.

Found by lint.

OK millert.
  • Loading branch information
ray committed Mar 19, 2008
1 parent 6a41b57 commit faae024
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/libc/string/bcmp.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: bcmp.c,v 1.8 2005/08/08 08:05:37 espie Exp $ */
/* $OpenBSD: bcmp.c,v 1.9 2008/03/19 03:00:23 ray Exp $ */

/*
* Copyright (c) 1987 Regents of the University of California.
Expand Down Expand Up @@ -44,12 +44,12 @@ bcmp(const void *b1, const void *b2, size_t length)
char *p1, *p2;

if (length == 0)
return(0);
return (0);
p1 = (char *)b1;
p2 = (char *)b2;
do
if (*p1++ != *p2++)
break;
return (1);
while (--length);
return(length);
return (0);
}

0 comments on commit faae024

Please sign in to comment.