about summary refs log tree commit diff homepage
path: root/runtime/klee-libc/bcmp.c
blob: 306523fb0192a8e6b3c3d0a3cb2918dbb10a7812 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*===-- bcmp.c ------------------------------------------------------------===//
//
//                     The KLEE Symbolic Virtual Machine
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===*/

#include <strings.h>

int bcmp(const void *s1, const void *s2, size_t n) {
  const unsigned char *p1 = s1, *p2 = s2;
  while (n-- != 0) {
    if (*p1++ != *p2++)
      return 1;
  }
  return 0;
}