add some coverage tests
[calc.git] / parser.c
index 9b6d5bb2f3f101a2d49c664c404f85fa789b70f4..c70a15cfde5b65282851d52587cd3920971c317f 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -829,38 +829,30 @@ char **generate_completion_list ()
                 list[i][j] = '\0';
             }
         }
-        if (list[l] == NULL) {
-            VERBOSE (ERROR, fprintf (stderr, "can't allocate memory\n"));
-            exit (1);
+        if (list[l] != NULL) {
+            l++;
         }
-        l++;
     }
 
     for (i = 0; i < NB_FUNCTIONS; i++) {
         list[l] = strdup ((functions + i)->keyword);
-        if (list[l] == NULL) {
-            VERBOSE (ERROR, fprintf (stderr, "can't allocate memory\n"));
-            exit (1);
+        if (list[l] != NULL) {
+            l++;
         }
-        l++;
     }
 
     for (i = 0; i < NB_CONSTANTS; i++) {
         list[l] = strdup ((constants + i)->keyword);
-        if (list[l] == NULL) {
-            VERBOSE (ERROR, fprintf (stderr, "can't allocate memory\n"));
-            exit (1);
+        if (list[l] != NULL) {
+            l++;
         }
-        l++;
     }
 
     for (i = 0; i < NB_SYMBOLS; i++) {
         list[l] = strdup (symbols[i]);
-        if (list[l] == NULL) {
-            VERBOSE (ERROR, fprintf (stderr, "can't allocate memory\n"));
-            exit (1);
+        if (list[l] != NULL) {
+            l++;
         }
-        l++;
     }
 
     return (list);