From 02a0232a881796c57cf68bf3575cd6f76b7db168 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Fri, 31 Jan 2014 14:40:51 +1000 Subject: Another null terminated array removal. --- dumbsh.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dumbsh.c b/dumbsh.c index d2a265b..cd4b554 100644 --- a/dumbsh.c +++ b/dumbsh.c @@ -168,8 +168,7 @@ static struct keyCommand simpleEmacsKeys[] = {"Home", startOfLine}, {"^A", startOfLine}, {"Up", prevHistory}, - {"^P", prevHistory}, - {NULL, NULL} + {"^P", prevHistory} }; static int handleKeySequence(long extra, char *sequence) @@ -177,7 +176,7 @@ static int handleKeySequence(long extra, char *sequence) int j; // Search for a key sequence bound to a command. - for (j = 0; simpleEmacsKeys[j].key; j++) + for (j = 0; j < (sizeof(simpleEmacsKeys) / sizeof(*simpleEmacsKeys)); j++) { if (strcmp(simpleEmacsKeys[j].key, sequence) == 0) { -- cgit v1.1