summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2010-08-01 09:38:34 +0200
committerBardur Arantsson <bardur@scientician.net>2010-08-01 10:28:32 +0200
commit5b231d5d603b897aa16835f6f70675c982874c3f (patch)
tree45d2bdcf103eedba2a8f59375db105d276de728b /src
parentba042a437d32a329b56058dbb4a91e36b898bd4a (diff)
Automatizer: Hopefully fix the long-standing memory corruption issues for good.
Diffstat (limited to 'src')
-rw-r--r--src/squeltch.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/squeltch.c b/src/squeltch.c
index 35d4387e..72a84f45 100644
--- a/src/squeltch.c
+++ b/src/squeltch.c
@@ -333,11 +333,11 @@ void do_cmd_automatizer()
}
else if (c == 'n')
{
- char name[20];
+ char name[20] = { '\0' };
char typ;
sprintf(name, "No name");
- if (input_box("Name?", hgt / 2, wid / 2, name, 15))
+ if (input_box("Name?", hgt / 2, wid / 2, name, sizeof(name)+1))
{
cptr styp = "nothing";
typ = msg_box("[D]estroy, [P]ickup, [I]nscribe, [N]othing rule?", hgt / 2, wid / 2);
@@ -350,10 +350,10 @@ void do_cmd_automatizer()
}
else if (c == 's')
{
- char name[30];
+ char name[30] = { '\0' };
sprintf(name, "automat.atm");
- if (input_box("Save name?", hgt / 2, wid / 2, name, sizeof(name)))
+ if (input_box("Save name?", hgt / 2, wid / 2, name, sizeof(name)+1))
{
char buf[1025];
char ch;