From: Nick Mathewson Date: Mon, 5 May 2008 19:19:47 +0000 (+0000) Subject: r19610@catbus: nickm | 2008-05-05 15:18:52 -0400 X-Git-Tag: release-2.0.1-alpha~322 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=caa368e1cc901abf75c02ae19d70d148a95e79ba;p=libevent r19610@catbus: nickm | 2008-05-05 15:18:52 -0400 Switch strcmp() tests in test_evbuffer() to use memcmp instead. Previously they broke on my Linux box. svn:r779 --- diff --git a/test/regress.c b/test/regress.c index 63eee8a2..45105341 100644 --- a/test/regress.c +++ b/test/regress.c @@ -980,13 +980,13 @@ test_evbuffer(void) evbuffer_validate(evb); if (EVBUFFER_LENGTH(evb) != 7 || - strcmp((char*)EVBUFFER_DATA(evb), "hello/1") != 0) + memcmp((char*)EVBUFFER_DATA(evb), "hello/1", 1) != 0) goto out; evbuffer_drain(evb, strlen("hello/")); evbuffer_validate(evb); if (EVBUFFER_LENGTH(evb) != 1 || - strcmp((char*)EVBUFFER_DATA(evb), "1") != 0) + memcmp((char*)EVBUFFER_DATA(evb), "1", 1) != 0) goto out; evbuffer_add_printf(evb_two, "%s", "/hello"); @@ -996,7 +996,7 @@ test_evbuffer(void) if (EVBUFFER_LENGTH(evb_two) != 0 || EVBUFFER_LENGTH(evb) != 7 || - strcmp((char*)EVBUFFER_DATA(evb), "1/hello") != 0) + memcmp((char*)EVBUFFER_DATA(evb), "1/hello", 7) != 0) goto out; memset(buffer, 0, sizeof(buffer));