diff --git a/winpr/libwinpr/thread/argv.c b/winpr/libwinpr/thread/argv.c index 6739150eb..52905b467 100644 --- a/winpr/libwinpr/thread/argv.c +++ b/winpr/libwinpr/thread/argv.c @@ -96,7 +96,7 @@ LPSTR* CommandLineToArgvA(LPCSTR lpCmdLine, int* pNumArgs) char* pEnd; char* buffer; char* pOutput; - int numArgs; + int numArgs = 0; LPSTR* pArgs; int maxNumArgs; int maxBufferSize; @@ -111,7 +111,6 @@ LPSTR* CommandLineToArgvA(LPCSTR lpCmdLine, int* pNumArgs) return NULL; pArgs = NULL; - numArgs = 0; lpEscapedCmdLine = NULL; cmdLineLength = (int) strlen(lpCmdLine); lpEscapedChars = (BOOL*) calloc(cmdLineLength + 1, sizeof(BOOL)); @@ -204,7 +203,6 @@ LPSTR* CommandLineToArgvA(LPCSTR lpCmdLine, int* pNumArgs) pArgs = (LPSTR*) buffer; pOutput = (char*) &buffer[maxNumArgs * (sizeof(char*))]; - numArgs = 0; p = (char*) lpCmdLine; while (p < lpCmdLine + cmdLineLength)