From 7c69bfa4109d955c37a8a2fecf80200c8a136216 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 20 Nov 2017 14:50:19 +0100 Subject: [PATCH] snprintf usage --- src/kernel/item.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kernel/item.c b/src/kernel/item.c index 6c5286813..9d750cb2f 100644 --- a/src/kernel/item.c +++ b/src/kernel/item.c @@ -342,7 +342,7 @@ void it_set_appearance(item_type *itype, const char *appearance) { if (appearance) { char plural[32]; itype->_appearance[0] = strdup(appearance); - snprintf(plural, "%29s_p", appearance); + snprintf(plural, sizeof(plural), "%s_p", appearance); itype->_appearance[1] = strdup(plural); } else { itype->_appearance[0] = 0;