diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2011-06-08 19:58:27 +0200 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2011-06-08 20:00:47 +0200 |
commit | 3bf808c3410a18508a70737329b0930f1693e262 (patch) | |
tree | 9e7136520e714a0a31c3e2bd3bc7eab38752af7d /src/test | |
parent | da3256b5aefb4cad706d9f239c9743ca396564c4 (diff) | |
download | tor-3bf808c3410a18508a70737329b0930f1693e262.tar.gz tor-3bf808c3410a18508a70737329b0930f1693e262.zip |
Fix a minor coverity-found bug in tests
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_util.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c index d338bbac9c..afc4d5ce92 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -1397,6 +1397,7 @@ run_util_spawn_background(const char *argv[], const char *expected_out, /* Check stdout */ pos = read_all(stdout_pipe, stdout_buf, sizeof(stdout_buf) - 1, 0); + tor_assert(pos >= 0); stdout_buf[pos] = '\0'; tt_int_op(pos, ==, strlen(expected_out)); tt_str_op(stdout_buf, ==, expected_out); @@ -1411,6 +1412,7 @@ run_util_spawn_background(const char *argv[], const char *expected_out, /* Check stderr */ pos = read_all(stderr_pipe, stderr_buf, sizeof(stderr_buf) - 1, 0); + tor_assert(pos >= 0); stderr_buf[pos] = '\0'; tt_int_op(pos, ==, strlen(expected_err)); tt_str_op(stderr_buf, ==, expected_err); |