]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
kresc: fix: possible uninitialized variable
authorStepan Balazik <stepan.balazik@nic.cz>
Mon, 6 Feb 2017 09:38:15 +0000 (10:38 +0100)
committerStepan Balazik <stepan.balazik@nic.cz>
Mon, 6 Feb 2017 09:38:15 +0000 (10:38 +0100)
daemon/kresc.c

index 201651ecc770f292f2aa9b52f08fca34baa58d12..ecac2d1a0a4bec95346edbd1f685a95a953e87b1 100644 (file)
@@ -142,7 +142,7 @@ static unsigned char complete(EditLine * el, int ch)
                }
                char *token = strtok(globals_tok, "\n");
                int matches = 0;
-               char *lastmatch;
+               char *lastmatch = NULL;
                while (token) {
                        if (argv[0] && starts_with(token, argv[0])) {
                                printf("\n%s (%s)", token,
@@ -207,7 +207,7 @@ static unsigned char complete(EditLine * el, int ch)
                        }
                        char *token = strtok(members_tok, "\n");
                        int matches = 0;
-                       char *lastmatch;
+                       char *lastmatch = NULL;
                        if (!dot || dot - argv[0] + 1 == strlen(argv[0])) {
                                //Prints all members.
                                while (token) {