mirror of
https://github.com/facebook/zstd.git
synced 2025-07-30 22:23:13 +03:00
fix command line interpretation
This commit is contained in:
@ -25,7 +25,6 @@
|
|||||||
**************************************/
|
**************************************/
|
||||||
#include "util.h" /* Compiler options, UTIL_HAS_CREATEFILELIST */
|
#include "util.h" /* Compiler options, UTIL_HAS_CREATEFILELIST */
|
||||||
#include <string.h> /* strcmp, strlen */
|
#include <string.h> /* strcmp, strlen */
|
||||||
#include <ctype.h> /* toupper */
|
|
||||||
#include <errno.h> /* errno */
|
#include <errno.h> /* errno */
|
||||||
#include "fileio.h"
|
#include "fileio.h"
|
||||||
#ifndef ZSTD_NOBENCH
|
#ifndef ZSTD_NOBENCH
|
||||||
@ -182,10 +181,13 @@ static unsigned readU32FromChar(const char** stringPtr)
|
|||||||
unsigned result = 0;
|
unsigned result = 0;
|
||||||
while ((**stringPtr >='0') && (**stringPtr <='9'))
|
while ((**stringPtr >='0') && (**stringPtr <='9'))
|
||||||
result *= 10, result += **stringPtr - '0', (*stringPtr)++ ;
|
result *= 10, result += **stringPtr - '0', (*stringPtr)++ ;
|
||||||
if (toupper(**stringPtr)=='K') result <<= 10, (*stringPtr)++ ;
|
if ((**stringPtr=='K') || (**stringPtr=='M')) {
|
||||||
else if (toupper(**stringPtr)=='M') result <<= 20, (*stringPtr)++ ;
|
result <<= 10;
|
||||||
if (toupper(**stringPtr)=='i') (*stringPtr)++;
|
if (**stringPtr=='M') result <<= 10;
|
||||||
if (toupper(**stringPtr)=='B') (*stringPtr)++;
|
(*stringPtr)++ ;
|
||||||
|
if (**stringPtr=='i') (*stringPtr)++;
|
||||||
|
if (**stringPtr=='B') (*stringPtr)++;
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user