From: Stepan Balazik Date: Mon, 6 Feb 2017 09:38:15 +0000 (+0100) Subject: kresc: fix: possible uninitialized variable X-Git-Tag: v1.3.0~23^2~84^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6b1e732845f67c557cd2d5501b23bc7679123d6a;p=thirdparty%2Fknot-resolver.git kresc: fix: possible uninitialized variable --- diff --git a/daemon/kresc.c b/daemon/kresc.c index 201651ecc..ecac2d1a0 100644 --- a/daemon/kresc.c +++ b/daemon/kresc.c @@ -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) {