diff options
-rw-r--r-- | main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -39,7 +39,7 @@ struct toy_list *toy_find(char *name) // If the name starts with "toybox" accept that as a match. Otherwise // skip the first entry, which is out of order. - if (!strncmp(name,"toybox",6)) return toy_list; + if (!strncmp(name, "toybox", 6)) return toy_list; bottom = 1; // Binary search to find this command. @@ -49,7 +49,7 @@ struct toy_list *toy_find(char *name) int result; middle = (top+bottom)/2; - if (middle<bottom || middle>top) return NULL; + if (middle<bottom || middle>top) return 0; result = strcmp(name,toy_list[middle].name); if (!result) return toy_list+middle; if (result<0) top = --middle; |