summaryrefslogtreecommitdiffstats
path: root/Panel.c
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2015-09-07 07:52:39 +0200
committerChristian Hesse <mail@eworm.de>2015-09-07 07:52:39 +0200
commite8970b6f3248e8c09480b0e9a5bddcee1fcddaca (patch)
tree805d2289d12bfe40cdd3272ff2ddb1c3eabc790d /Panel.c
parent2df36ee2f291c12bbff30bc6433b76628ea11f0a (diff)
fix calloc() calls
* size_t nmemb (number of elements) first, then size_t size * do not assume char is size 1 but use sizeof() * allocate for char, not pointer to char (found by Michael McConville, fixes #261)
Diffstat (limited to 'Panel.c')
-rw-r--r--Panel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Panel.c b/Panel.c
index 65409706..7424fa49 100644
--- a/Panel.c
+++ b/Panel.c
@@ -455,7 +455,7 @@ bool Panel_onKey(Panel* this, int key) {
HandlerResult Panel_selectByTyping(Panel* this, int ch) {
int size = Panel_size(this);
if (!this->eventHandlerState)
- this->eventHandlerState = calloc(100, 1);
+ this->eventHandlerState = calloc(100, sizeof(char));
char* buffer = this->eventHandlerState;
if (ch < 255 && isalnum(ch)) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy