From a4f386919bee975c05eced0e56e99dc0d59599ef Mon Sep 17 00:00:00 2001 From: Julian Büning Date: Sat, 31 Aug 2019 23:44:56 +0200 Subject: klee-libc: add bcmp --- runtime/klee-libc/bcmp.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 runtime/klee-libc/bcmp.c (limited to 'runtime/klee-libc') diff --git a/runtime/klee-libc/bcmp.c b/runtime/klee-libc/bcmp.c new file mode 100644 index 00000000..23e1c233 --- /dev/null +++ b/runtime/klee-libc/bcmp.c @@ -0,0 +1,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 + +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; +} -- cgit 1.4.1