cut 'n paste bug fixed
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1344 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
+2
-2
@@ -594,14 +594,14 @@ static int
|
|||||||
parseIntOption (const char *str, int *result, const char *optName)
|
parseIntOption (const char *str, int *result, const char *optName)
|
||||||
{
|
{
|
||||||
char *endPtr;
|
char *endPtr;
|
||||||
float temp;
|
int temp;
|
||||||
|
|
||||||
if (str[0] == '\0')
|
if (str[0] == '\0')
|
||||||
{
|
{
|
||||||
fprintf (stderr, "Error: Invalid value for '%s'.\n", optName);
|
fprintf (stderr, "Error: Invalid value for '%s'.\n", optName);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
temp = (float) strtol(str, &endPtr, 10);
|
temp = (int) strtol(str, &endPtr, 10);
|
||||||
if (*endPtr != '\0')
|
if (*endPtr != '\0')
|
||||||
{
|
{
|
||||||
fprintf (stderr, "Error: Junk characters in argument '%s'.\n",
|
fprintf (stderr, "Error: Junk characters in argument '%s'.\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user