[systemd-commits] src/test
Thomas H.P. Andersen
phomes at kemper.freedesktop.org
Tue Sep 16 13:02:35 PDT 2014
src/test/test-fileio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit cca0efb0477f9bb7d61b48ba270b885b29c0bb72
Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
Date: Tue Sep 16 21:59:50 2014 +0200
test: silence a coverity report
We check the actual contents of the file on the line after but we
might as well also check the number of bytes read here.
Found by coverity. Fixes: CID#1237521
diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c
index e69706c..92aa794 100644
--- a/src/test/test-fileio.c
+++ b/src/test/test-fileio.c
@@ -325,7 +325,7 @@ static void test_write_string_file(void) {
assert_se(write_string_file(fn, "boohoo") == 0);
- assert_se(read(fd, buf, sizeof(buf)));
+ assert_se(read(fd, buf, sizeof(buf)) == 7);
assert_se(streq(buf, "boohoo\n"));
unlink(fn);
More information about the systemd-commits
mailing list