From 9fbb56d12c95c37a083babde00a644d5be20fb13 Mon Sep 17 00:00:00 2001 From: MissValeska Date: Sun, 17 Aug 2014 09:51:19 -0700 Subject: [PATCH] Fixed some more warnings. --- src/Ntk-Console/Netsukuku-Console.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Ntk-Console/Netsukuku-Console.c b/src/Ntk-Console/Netsukuku-Console.c index 598be3e..5508b43 100644 --- a/src/Ntk-Console/Netsukuku-Console.c +++ b/src/Ntk-Console/Netsukuku-Console.c @@ -23,7 +23,7 @@ int validity_check(char *request) { else if(strncmp(request,"console_uptime", (int)strlen(request)) == 0) return 4; - else if(strlen(request) > 250) + else if(strlen(request) > BUFFER_LENGTH) return 5; else if(strncmp(request,"inet_connected", (int)strlen(request)) == 0) @@ -70,7 +70,7 @@ void response_cleanup(char response[BUFFER_LENGTH]) { size_t len_left = sizeof(response) - (c+1-response); memmove(c, c+1, len_left); } - } + } printf("Sent and received Successfully!\n The Response was: %s", response); } @@ -218,10 +218,14 @@ int main(void) { printf("This is the Netsukuku Console, Please type 'help' for more information.\n"); - char * request; + char * request; + + char *request1; request = (char *)malloc(BUFFER_LENGTH); + request1 = (char*)malloc(BUFFER_LENGTH); + do { printf("\n>"); @@ -230,6 +234,8 @@ int main(void) { fflush(stdin); + strcpy(request, request1); + console(request); } while(FALSE);