Skip to content

Commit

Permalink
Allow floating point values in memory command line options
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisJefferson committed Apr 10, 2019
1 parent 27c845b commit d57645b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ static sizeMultiplier memoryUnits[]= {

static UInt ParseMemory( Char * s)
{
UInt size = atol(s);
double size = atof(s);
Char symbol = s[strlen(s)-1];
UInt i;
UInt maxmem;
Expand All @@ -882,10 +882,9 @@ static UInt ParseMemory( Char * s)
if (symbol == memoryUnits[i].symbol) {
UInt value = memoryUnits[i].value;
if (size > maxmem/value)
size = maxmem;
return maxmem;
else
size *= value;
return size;
return size * value;
}
}
if (!IsDigit(symbol))
Expand Down

0 comments on commit d57645b

Please sign in to comment.