1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 3 #include <string.h> 4 memcmp(const void * src1,const void * src2,size_t bytes)5int memcmp(const void *src1, const void *src2, size_t bytes) 6 { 7 const unsigned char *s1, *s2; 8 int result; 9 s1 = src1; 10 s2 = src2; 11 result = 0; 12 while ((bytes > 0) && (result == 0)) { 13 result = *s1 - *s2; 14 bytes--; 15 s1++; 16 s2++; 17 } 18 return result; 19 } 20