diff options
author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2010-06-11 16:04:59 (GMT) |
---|---|---|
committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2010-06-11 16:04:59 (GMT) |
commit | 177e8530cbf5ece4264d48da3c11a7e1fc45dcb4 (patch) | |
tree | 3c0fa69fff00f24eb799f7cfad03669e73d7bf7f /Modules/_struct.c | |
parent | 9b88b916a903d97e3125b4436ac5c14620a78238 (diff) | |
download | cpython-177e8530cbf5ece4264d48da3c11a7e1fc45dcb4.zip cpython-177e8530cbf5ece4264d48da3c11a7e1fc45dcb4.tar.gz cpython-177e8530cbf5ece4264d48da3c11a7e1fc45dcb4.tar.bz2 |
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 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; |