X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=parser.c;h=2e83a4f451f74a766e1b70e2b3c2f3567eafdf50;hb=3d3e6770191a1eb48cf66898397a1a6e31b7cb89;hp=714ea87168fb069db17fb72c0393bbee9666a304;hpb=0a8a1de32bdcdad2e60958af32ccf324fa81e144;p=calc.git diff --git a/parser.c b/parser.c index 714ea87..2e83a4f 100644 --- a/parser.c +++ b/parser.c @@ -896,15 +896,16 @@ void savestring (int id, char *string) } } } - if (n == -1) { - VERBOSE (WARNING, fprintf (stdout, "error unknown program (%d)\n", id)); - return; - } - /* save program */ - if ((programs + n)->string) { - free ((programs + n)->string); - } + /* unnecesary code */ + //if (n == -1) { + // VERBOSE (WARNING, fprintf (stdout, "error unknown program (%d)\n", id)); + // return; + //} + //if ((programs + n)->string) { + // free ((programs + n)->string); + //} + (programs + n)->string = strdup (string); } @@ -1209,7 +1210,7 @@ void free_completion_list (char **list) int i; if (list) { - for (i = 0; i < NB_FUNCTIONS + NB_CONSTANTS; i++) { + for (i = 0; i < NB_OPERATORS + NB_FUNCTIONS + NB_CONSTANTS + NB_SYMBOLS + 1; i++) { if (list[i] != NULL) { free (list[i]); }