diff options
author | Marian Klymov <nekto1989@gmail.com> | 2018-06-02 23:52:56 +0300 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-06-11 11:14:48 +0200 |
commit | c45360d4633850839bb9c2d77dbf8a8285e9ad49 (patch) | |
tree | 20159c553a74ed98c2431fc8f2852067f79ac4e9 /tests/server/util.c | |
parent | 38203f1585da53e07e54e37c7d5da4d72f509a2e (diff) | |
download | curl-c45360d4633850839bb9c2d77dbf8a8285e9ad49.tar.gz |
cppcheck: fix warnings
- Get rid of variable that was generating false positive warning
(unitialized)
- Fix issues in tests
- Reduce scope of several variables all over
etc
Closes #2631
Diffstat (limited to 'tests/server/util.c')
-rw-r--r-- | tests/server/util.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/server/util.c b/tests/server/util.c index fdbd71f0f..df681968d 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -101,7 +101,6 @@ void logmsg(const char *msg, ...) va_list ap; char buffer[2048 + 1]; FILE *logfp; - int error; struct timeval tv; time_t sec; struct tm *now; @@ -135,7 +134,7 @@ void logmsg(const char *msg, ...) fclose(logfp); } else { - error = errno; + int error = errno; fprintf(stderr, "fopen() failed with error: %d %s\n", error, strerror(error)); fprintf(stderr, "Error opening file: %s\n", serverlogfile); @@ -217,7 +216,6 @@ int wait_ms(int timeout_ms) #endif struct timeval initial_tv; int pending_ms; - int error; #endif int r = 0; @@ -235,6 +233,7 @@ int wait_ms(int timeout_ms) pending_ms = timeout_ms; initial_tv = tvnow(); do { + int error; #if defined(HAVE_POLL_FINE) r = poll(NULL, 0, pending_ms); #else |