summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c2fdce9)
raw | patch | inline | side by side (parent: c2fdce9)
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Sat, 24 Dec 2011 17:28:04 +0000 (18:28 +0100) | ||
committer | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Sat, 24 Dec 2011 17:28:04 +0000 (18:28 +0100) |
It was only used in one function. Use sizeof(buf) instead.
src/screen_keydef.c | patch | blob | history |
diff --git a/src/screen_keydef.c b/src/screen_keydef.c
index 800e54f4b807f5783bafb6484bed0dd01badcdda..0f46eee85fbf5e90572013dc479afedfc8e50713 100644 (file)
--- a/src/screen_keydef.c
+++ b/src/screen_keydef.c
#define STATIC_ITEMS 0
#define STATIC_SUB_ITEMS 1
-#define BUFSIZE 256
#define LIST_ITEM_APPLY() ((unsigned)command_list_length)
#define LIST_ITEM_SAVE() (LIST_ITEM_APPLY()+1)
static const char *
list_callback(unsigned idx, G_GNUC_UNUSED void *data)
{
- static char buf[BUFSIZE];
+ static char buf[256];
if (subcmd < 0) {
if (idx == LIST_ITEM_APPLY())
return "[..]";
idx--;
if (idx == subcmd_addpos) {
- g_snprintf(buf, BUFSIZE, "%d. %s",
+ g_snprintf(buf, sizeof(buf), "%d. %s",
idx + 1, _("Add new key"));
return buf;
}
assert(idx < MAX_COMMAND_KEYS && cmds[subcmd].keys[idx] > 0);
- g_snprintf(buf,
- BUFSIZE, "%d. %-20s (%d) ",
+ g_snprintf(buf, sizeof(buf),
+ "%d. %-20s (%d) ",
idx + 1,
key2str(cmds[subcmd].keys[idx]),
cmds[subcmd].keys[idx]);