Skip to content

Commit 95540f0

Browse files
committed
Minor style change to fit surrounding code
1 parent 0569d03 commit 95540f0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Modules/binascii.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -967,18 +967,20 @@ binascii_a2b_base85_impl(PyObject *module, Py_buffer *data, int strict_mode)
967967
if (leftchar > UINT32_MAX / 85 ||
968968
(leftchar *= 85) > UINT32_MAX - this_digit) {
969969
state = get_binascii_state(module);
970-
if (state != NULL) {
971-
PyErr_SetString(state->Error, "base85 overflow");
970+
if (state == NULL) {
971+
goto error_end;
972972
}
973+
PyErr_SetString(state->Error, "base85 overflow");
973974
goto error_end;
974975
}
975976
leftchar += this_digit;
976977
group_pos++;
977978
} else if (strict_mode) {
978979
state = get_binascii_state(module);
979-
if (state != NULL) {
980-
PyErr_Format(state->Error, "'%c' invalid in base85", this_ch);
980+
if (state == NULL) {
981+
goto error_end;
981982
}
983+
PyErr_Format(state->Error, "'%c' invalid in base85", this_ch);
982984
goto error_end;
983985
}
984986

0 commit comments

Comments
 (0)