diff options
author | Steven Murdoch <Steven.Murdoch@cl.cam.ac.uk> | 2010-10-07 22:30:40 +0100 |
---|---|---|
committer | Steven Murdoch <Steven.Murdoch@cl.cam.ac.uk> | 2010-10-10 19:08:44 +0100 |
commit | 23e9f362a28f576fb177958d411ebd8c5995500a (patch) | |
tree | 08c9e1ff2a5dabf17480a570cfddfd074921ba0f | |
parent | 4d694c789024d2a4a2fb1edfb3b0eaa7ac192108 (diff) | |
download | tor-23e9f362a28f576fb177958d411ebd8c5995500a.tar.gz tor-23e9f362a28f576fb177958d411ebd8c5995500a.zip |
Fix issues in nickm's review of log_from_pipe for bug #1903
- Replace sscanf with tor_sscanf
- Replace use of strstr with equivalent call to strcmpstart
-rw-r--r-- | src/common/util.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/util.c b/src/common/util.c index ed870db5d5..ae18cd5525 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -3177,11 +3177,11 @@ log_from_pipe(FILE *stream, int severity, const char *executable, } /* Check if buf starts with SPAWN_ERROR_MESSAGE */ - if (strstr(buf, SPAWN_ERROR_MESSAGE) == buf) { + if (strcmpstart(buf, SPAWN_ERROR_MESSAGE) == 0) { /* Parse error message */ int retval, child_state, saved_errno; - retval = sscanf(buf, SPAWN_ERROR_MESSAGE "%d/%d", - &child_state, &saved_errno); + retval = tor_sscanf(buf, SPAWN_ERROR_MESSAGE "%x/%x", + &child_state, &saved_errno); if (retval == 2) { log_warn(LD_GENERAL, "Failed to start child process \"%s\" in state %d: %s", |