projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7c63b23
)
test: fileio - make coverity happy
author
Tom Gundersen
<teg@jklm.no>
Tue, 4 Nov 2014 15:19:26 +0000
(16:19 +0100)
committer
Tom Gundersen
<teg@jklm.no>
Wed, 5 Nov 2014 15:54:22 +0000
(16:54 +0100)
Explicitly check the length of the read.
Fixes CID#1250803.
src/test/test-fileio.c
patch
|
blob
|
history
diff --git
a/src/test/test-fileio.c
b/src/test/test-fileio.c
index
a713abd
..
c26a6fa
100644
(file)
--- a/
src/test/test-fileio.c
+++ b/
src/test/test-fileio.c
@@
-342,7
+342,7
@@
static void test_write_string_file_no_create(void) {
assert_se(write_string_file_no_create("/a/file/which/does/not/exists/i/guess", "boohoo") < 0);
assert_se(write_string_file_no_create(fn, "boohoo") == 0);
- assert_se(read(fd, buf, sizeof(buf)));
+ assert_se(read(fd, buf, sizeof(buf))
== strlen("boohoo\n")
);
assert_se(streq(buf, "boohoo\n"));
unlink(fn);