diff options
author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2010-06-11 16:04:59 +0000 |
---|---|---|
committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2010-06-11 16:04:59 +0000 |
commit | fc6be6b145adb4396c73f9ce43383f7613ca76de (patch) | |
tree | 4fe3049634c873c548352764e8746b0d9974ccb6 /Modules/_struct.c | |
parent | 69a725ee9be6e5468b924769b50fa76d2595195a (diff) | |
download | cpython-fc6be6b145adb4396c73f9ce43383f7613ca76de.tar.gz |
Issue #3129: Trailing digits in format string are no longer ignored.
Diffstat (limited to 'Modules/_struct.c')
-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 26179cc572..2e594e8f78 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; |