summaryrefslogtreecommitdiff
path: root/Modules/_struct.c
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-06-11 16:04:59 +0000
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-06-11 16:04:59 +0000
commitfc6be6b145adb4396c73f9ce43383f7613ca76de (patch)
tree4fe3049634c873c548352764e8746b0d9974ccb6 /Modules/_struct.c
parent69a725ee9be6e5468b924769b50fa76d2595195a (diff)
downloadcpython-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.c7
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;