blob: 1d016c7557060032c27fad99c7c175e42408824d [file] [log] [blame]
sewardjde4a1d02002-03-22 01:27:54 +00001#include <string.h>
2#include <stdio.h>
njn25e49d8e72002-09-23 09:36:25 +00003#include <stdlib.h>
sewardjde4a1d02002-03-22 01:27:54 +00004
njn16eeb4e2005-06-16 03:56:58 +00005// An issue here is that in glibc memcmp() and bcmp() are aliases. Valgrind
6// chooses the shorter name -- bcmp -- and reports that in the error
7// message, even though memcmp() was called. This is hard to avoid.
8char *s1, *s2;
sewardjde4a1d02002-03-22 01:27:54 +00009int main ( void )
10{
11 s1 = malloc(10); strcpy(s1,"fooble");
12 s2 = malloc(10); strcpy(s2,"fooble");
13 if (memcmp(s1, s2, 8) != 0)
14 printf("different\n");
15 else
16 printf("same (?!)\n");
17 return 0;
18}
19
20