aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-08-21 17:54:13 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-08-21 17:54:13 +0200
commit1e83ca126e37acdd3b498b797a47c90a5a2230b0 (patch)
treed0f0aefd1cac9028269d355d639320d211ee4b50
parent5419da63071a8e4b42792cbd724ffb245c76068b (diff)
fix stack corruption in dw_float_test
-rw-r--r--test/dw_float_test.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/dw_float_test.cc b/test/dw_float_test.cc
index daf19695..1da4c5aa 100644
--- a/test/dw_float_test.cc
+++ b/test/dw_float_test.cc
@@ -86,8 +86,8 @@ int main(int argc, char **argv)
wordStyle = Style::create (layout, &styleAttrs);
for(int i = 1; i <= 10; i++) {
- char buf[4];
- sprintf(buf, "%d%s",
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%d%s",
i, (i == 1 ? "st" : (i == 2 ? "nd" : (i == 3 ? "rd" : "th"))));
char *words[] = { "This", "is", "the", buf, "paragraph.",