removed sprintf usage from zstdcli.c
some static analyzers flag this standard C90 function as unsafe.
This commit is contained in:
+3
-2
@@ -1148,7 +1148,6 @@ int main(int argCount, const char* argv[])
|
||||
|
||||
argument++;
|
||||
while (argument[0]!=0) {
|
||||
char shortArgument[3];
|
||||
|
||||
#ifndef ZSTD_NOCOMPRESS
|
||||
/* compression Level */
|
||||
@@ -1281,11 +1280,13 @@ int main(int argCount, const char* argv[])
|
||||
|
||||
/* unknown command */
|
||||
default :
|
||||
sprintf(shortArgument, "-%c", argument[0]);
|
||||
{ char shortArgument[3] = {'-', 0, 0};
|
||||
shortArgument[1] = argument[0];
|
||||
badUsage(programName, shortArgument);
|
||||
CLEAN_RETURN(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
continue;
|
||||
} /* if (argument[0]=='-') */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user