diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2019-09-09 20:44:18 +0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2019-09-09 20:44:25 +0200 |
commit | a576156e5bf9de147efe2c76af1ee29f5efd773e (patch) | |
tree | a72f60f78cd4db77ce5d10d084b6d1c8e1e0fe27 /tests/common/check_utils.c | |
parent | c9df78f02b66513c6e831d81c3240a715fee7e70 (diff) | |
download | blogc-a576156e5bf9de147efe2c76af1ee29f5efd773e.tar.gz blogc-a576156e5bf9de147efe2c76af1ee29f5efd773e.tar.bz2 blogc-a576156e5bf9de147efe2c76af1ee29f5efd773e.zip |
common: prevent stdarg errors when format is NULL
Diffstat (limited to 'tests/common/check_utils.c')
-rw-r--r-- | tests/common/check_utils.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/common/check_utils.c b/tests/common/check_utils.c index cc14f4e..471cd77 100644 --- a/tests/common/check_utils.c +++ b/tests/common/check_utils.c @@ -117,6 +117,7 @@ test_strndup(void **state) static void test_strdup_printf(void **state) { + assert_null(bc_strdup_printf(NULL)); char *str = bc_strdup_printf("bola"); assert_string_equal(str, "bola"); free(str); @@ -554,6 +555,9 @@ static void test_string_append_printf(void **state) { bc_string_t *str = bc_string_new(); + str = bc_string_append_printf(str, NULL); + assert_string_equal(str->str, ""); + assert_non_null(str); str = bc_string_append_printf(str, "guda: %s %d", "bola", 1); assert_non_null(str); assert_string_equal(str->str, "guda: bola 1"); |