summaryrefslogtreecommitdiff
path: root/tests/test_voicemail_api.c
diff options
context:
space:
mode:
authorDavid M. Lee <dlee@digium.com>2013-07-11 04:34:49 +0000
committerDavid M. Lee <dlee@digium.com>2013-07-11 04:34:49 +0000
commitd3939686cdd2f198c5779621d18f0a79a7739976 (patch)
treeb1d4fc4f00fd5af38ed6ee2f4cedf2b8cbb256eb /tests/test_voicemail_api.c
parent31a58b2604c5f551a817f4153a32cc56e5c6da49 (diff)
test_voicemail_api: fix warning found by gcc-4.8
The voicemail_api test had code like strncmp(a, b, sizeof(a)), but a was a char pointer, instead of a literal or char array. This meant that sizeof was the size of the pointer, not the length of the string. Since the string is in a stringfield and should be null terminated, I just changed it to a plain strcmp. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'tests/test_voicemail_api.c')
-rw-r--r--tests/test_voicemail_api.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_voicemail_api.c b/tests/test_voicemail_api.c
index f80c5b9c9..30f6f11e0 100644
--- a/tests/test_voicemail_api.c
+++ b/tests/test_voicemail_api.c
@@ -87,7 +87,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
* object is test_mbox_snapshot
*/
#define VM_API_STRING_FIELD_VERIFY(expected, actual) do { \
- if (strncmp((expected), (actual), sizeof((expected)))) { \
+ if (strcmp((expected), (actual))) { \
ast_test_status_update(test, "Test failed for parameter %s: Expected [%s], Actual [%s]\n", #actual, expected, actual); \
VM_API_SNAPSHOT_TEST_CLEANUP; \
return AST_TEST_FAIL; \