diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_struct.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c index 26179cc..2e594e8 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -1195,8 +1195,11 @@ prepare_s(PyStructObject *self) } num = x; } - if (c == '\0') - break; + if (c == '\0') { + PyErr_SetString(StructError, + "repeat count given without format specifier"); + return -1; + } } else num = 1; |