diff options
author | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2013-12-12 23:08:47 +0100 |
---|---|---|
committer | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2013-12-12 23:08:47 +0100 |
commit | 5fba7bbfa47ef5c03a28000252d06ec82405d461 (patch) | |
tree | 0eb31cb025d794fc999aeebb92c93b5e00b18b8d /src/test/test-fileio.c | |
parent | e4bb80a07610e6559aa6d2d763fd0b78634a4b12 (diff) |
scan-build: silence some warnings
test-fileio/test-strv:
Use the streq_ptr to make build-scan not worry about passing in a null
to a nonnull function.
test-dhcp-option:
Prevent a theoretical null pointer dereference
Diffstat (limited to 'src/test/test-fileio.c')
-rw-r--r-- | src/test/test-fileio.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c index b005f3b4e6..eb4fbc91d2 100644 --- a/src/test/test-fileio.c +++ b/src/test/test-fileio.c @@ -78,16 +78,16 @@ static void test_parse_env_file(void) { STRV_FOREACH(i, a) log_info("Got: <%s>", *i); - assert_se(streq(a[0], "one=BAR")); - assert_se(streq(a[1], "two=bar")); - assert_se(streq(a[2], "three=333\nxxxx")); - assert_se(streq(a[3], "four=44\"44")); - assert_se(streq(a[4], "five=55\'55FIVEcinco")); - assert_se(streq(a[5], "six=seis sechs sis")); - assert_se(streq(a[6], "seven=sevenval#nocomment")); - assert_se(streq(a[7], "eight=eightval #nocomment")); - assert_se(streq(a[8], "export nine=nineval")); - assert_se(streq(a[9], "ten=")); + assert_se(streq_ptr(a[0], "one=BAR")); + assert_se(streq_ptr(a[1], "two=bar")); + assert_se(streq_ptr(a[2], "three=333\nxxxx")); + assert_se(streq_ptr(a[3], "four=44\"44")); + assert_se(streq_ptr(a[4], "five=55\'55FIVEcinco")); + assert_se(streq_ptr(a[5], "six=seis sechs sis")); + assert_se(streq_ptr(a[6], "seven=sevenval#nocomment")); + assert_se(streq_ptr(a[7], "eight=eightval #nocomment")); + assert_se(streq_ptr(a[8], "export nine=nineval")); + assert_se(streq_ptr(a[9], "ten=")); assert_se(a[10] == NULL); strv_env_clean_log(a, "test"); @@ -185,9 +185,9 @@ static void test_parse_multiline_env_file(void) { STRV_FOREACH(i, a) log_info("Got: <%s>", *i); - assert_se(streq(a[0], "one=BAR VAR\tGAR")); - assert_se(streq(a[1], "two=bar var\tgar")); - assert_se(streq(a[2], "tri=bar var \tgar ")); + assert_se(streq_ptr(a[0], "one=BAR VAR\tGAR")); + assert_se(streq_ptr(a[1], "two=bar var\tgar")); + assert_se(streq_ptr(a[2], "tri=bar var \tgar ")); assert_se(a[3] == NULL); r = write_env_file(p, a); |