mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-25 04:43:31 +01:00
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
This commit is contained in:
parent
4d694c7890
commit
23e9f362a2
@ -3177,10 +3177,10 @@ log_from_pipe(FILE *stream, int severity, const char *executable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check if buf starts with SPAWN_ERROR_MESSAGE */
|
/* 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 */
|
/* Parse error message */
|
||||||
int retval, child_state, saved_errno;
|
int retval, child_state, saved_errno;
|
||||||
retval = sscanf(buf, SPAWN_ERROR_MESSAGE "%d/%d",
|
retval = tor_sscanf(buf, SPAWN_ERROR_MESSAGE "%x/%x",
|
||||||
&child_state, &saved_errno);
|
&child_state, &saved_errno);
|
||||||
if (retval == 2) {
|
if (retval == 2) {
|
||||||
log_warn(LD_GENERAL,
|
log_warn(LD_GENERAL,
|
||||||
|
Loading…
Reference in New Issue
Block a user