aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-01-31 14:40:51 +1000
committerDavid Walter Seikel2014-01-31 14:40:51 +1000
commit02a0232a881796c57cf68bf3575cd6f76b7db168 (patch)
tree0a411975aaf422b7e0ad33c43238a6adb8897fbc
parentMore gratuitous name changes. (diff)
downloadboxes-02a0232a881796c57cf68bf3575cd6f76b7db168.zip
boxes-02a0232a881796c57cf68bf3575cd6f76b7db168.tar.gz
boxes-02a0232a881796c57cf68bf3575cd6f76b7db168.tar.bz2
boxes-02a0232a881796c57cf68bf3575cd6f76b7db168.tar.xz
Another null terminated array removal.
-rw-r--r--dumbsh.c5
1 files 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[] =
168 {"Home", startOfLine}, 168 {"Home", startOfLine},
169 {"^A", startOfLine}, 169 {"^A", startOfLine},
170 {"Up", prevHistory}, 170 {"Up", prevHistory},
171 {"^P", prevHistory}, 171 {"^P", prevHistory}
172 {NULL, NULL}
173}; 172};
174 173
175static int handleKeySequence(long extra, char *sequence) 174static int handleKeySequence(long extra, char *sequence)
@@ -177,7 +176,7 @@ static int handleKeySequence(long extra, char *sequence)
177 int j; 176 int j;
178 177
179 // Search for a key sequence bound to a command. 178 // Search for a key sequence bound to a command.
180 for (j = 0; simpleEmacsKeys[j].key; j++) 179 for (j = 0; j < (sizeof(simpleEmacsKeys) / sizeof(*simpleEmacsKeys)); j++)
181 { 180 {
182 if (strcmp(simpleEmacsKeys[j].key, sequence) == 0) 181 if (strcmp(simpleEmacsKeys[j].key, sequence) == 0)
183 { 182 {