Instead, just return 1 if there is a difference, else 0.
Fixed by ray@ in 2008 but the libkern version was not synced.
OK deraadt@
-/* $OpenBSD: bcmp.c,v 1.13 2021/05/16 04:51:00 jsg Exp $ */
+/* $OpenBSD: bcmp.c,v 1.14 2023/07/13 20:33:30 millert Exp $ */
/*
* Copyright (c) 1987 Regents of the University of California.
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);
}