mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 05:33:47 +01:00
Fix some logging on failed apply_ed_diff
This commit is contained in:
parent
97620cf18f
commit
06017f35e8
@ -670,15 +670,15 @@ apply_ed_diff(smartlist_t *cons1, smartlist_t *diff)
|
|||||||
if (*endptr1 == ',') {
|
if (*endptr1 == ',') {
|
||||||
end = (int)strtol(endptr1+1, &endptr2, 10);
|
end = (int)strtol(endptr1+1, &endptr2, 10);
|
||||||
if (endptr2 == endptr1+1) {
|
if (endptr2 == endptr1+1) {
|
||||||
goto error_cleanup;
|
|
||||||
log_warn(LD_CONSDIFF, "Could not apply consensus diff because "
|
log_warn(LD_CONSDIFF, "Could not apply consensus diff because "
|
||||||
"an ed command was missing a range end line number.");
|
"an ed command was missing a range end line number.");
|
||||||
|
goto error_cleanup;
|
||||||
}
|
}
|
||||||
/* Incoherent range. */
|
/* Incoherent range. */
|
||||||
if (end <= start) {
|
if (end <= start) {
|
||||||
goto error_cleanup;
|
|
||||||
log_warn(LD_CONSDIFF, "Could not apply consensus diff because "
|
log_warn(LD_CONSDIFF, "Could not apply consensus diff because "
|
||||||
"an invalid range was found in an ed command.");
|
"an invalid range was found in an ed command.");
|
||||||
|
goto error_cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We'll take <n1> as <n1>,<n1> for simplicity. */
|
/* We'll take <n1> as <n1>,<n1> for simplicity. */
|
||||||
@ -693,6 +693,12 @@ apply_ed_diff(smartlist_t *cons1, smartlist_t *diff)
|
|||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (*endptr2 == '\0') {
|
||||||
|
log_warn(LD_CONSDIFF, "Could not apply consensus diff because "
|
||||||
|
"a line with no ed command was found");
|
||||||
|
goto error_cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
if (*(endptr2+1) != '\0') {
|
if (*(endptr2+1) != '\0') {
|
||||||
log_warn(LD_CONSDIFF, "Could not apply consensus diff because "
|
log_warn(LD_CONSDIFF, "Could not apply consensus diff because "
|
||||||
"an ed command longer than one char was found.");
|
"an ed command longer than one char was found.");
|
||||||
|
Loading…
Reference in New Issue
Block a user