summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-06-11 16:04:59 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-06-11 16:04:59 (GMT)
commit177e8530cbf5ece4264d48da3c11a7e1fc45dcb4 (patch)
tree3c0fa69fff00f24eb799f7cfad03669e73d7bf7f /Modules
parent9b88b916a903d97e3125b4436ac5c14620a78238 (diff)
downloadcpython-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')
-rw-r--r--Modules/_struct.c7
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;