projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gfio: move disk utilization to a private tab in per-client results
[fio.git]
/
parse.c
diff --git
a/parse.c
b/parse.c
index 6ea7c103c0973a259ec6227355161e5139a63025..cdd9ac7e3cf0cb9e81a25d2fd43aba205c90ce88 100644
(file)
--- a/
parse.c
+++ b/
parse.c
@@
-153,32
+153,32
@@
static unsigned long long __get_mult_bytes(const char *p, void *data,
for (i = 0; i < strlen(c); i++)
c[i] = tolower(c[i]);
for (i = 0; i < strlen(c); i++)
c[i] = tolower(c[i]);
- if (!str
cmp("pib", c
)) {
+ if (!str
ncmp("pib", c, 3
)) {
pow = 5;
mult = 1000;
pow = 5;
mult = 1000;
- } else if (!str
cmp("tib", c
)) {
+ } else if (!str
ncmp("tib", c, 3
)) {
pow = 4;
mult = 1000;
pow = 4;
mult = 1000;
- } else if (!str
cmp("gib", c
)) {
+ } else if (!str
ncmp("gib", c, 3
)) {
pow = 3;
mult = 1000;
pow = 3;
mult = 1000;
- } else if (!str
cmp("mib", c
)) {
+ } else if (!str
ncmp("mib", c, 3
)) {
pow = 2;
mult = 1000;
pow = 2;
mult = 1000;
- } else if (!str
cmp("kib", c
)) {
+ } else if (!str
ncmp("kib", c, 3
)) {
pow = 1;
mult = 1000;
pow = 1;
mult = 1000;
- } else if (!str
cmp("p", c) || !strcmp("pb", c
))
+ } else if (!str
ncmp("p", c, 1) || !strncmp("pb", c, 2
))
pow = 5;
pow = 5;
- else if (!str
cmp("t", c) || !strcmp("tb", c
))
+ else if (!str
ncmp("t", c, 1) || !strncmp("tb", c, 2
))
pow = 4;
pow = 4;
- else if (!str
cmp("g", c) || !strcmp("gb", c
))
+ else if (!str
ncmp("g", c, 1) || !strncmp("gb", c, 2
))
pow = 3;
pow = 3;
- else if (!str
cmp("m", c) || !strcmp("mb", c
))
+ else if (!str
ncmp("m", c, 1) || !strncmp("mb", c, 2
))
pow = 2;
pow = 2;
- else if (!str
cmp("k", c) || !strcmp("kb", c
))
+ else if (!str
ncmp("k", c, 1) || !strncmp("kb", c, 2
))
pow = 1;
pow = 1;
- else if (!str
cmp("%", c
)) {
+ else if (!str
ncmp("%", c, 1
)) {
*percent = 1;
free(c);
return ret;
*percent = 1;
free(c);
return ret;
@@
-220,7
+220,7
@@
static unsigned long long get_mult_bytes(const char *str, int len, void *data,
/*
* Convert string into a floating number. Return 1 for success and 0 otherwise.
*/
/*
* Convert string into a floating number. Return 1 for success and 0 otherwise.
*/
-int str_to_float(const char *str, double *val)
+
static
int str_to_float(const char *str, double *val)
{
return (1 == sscanf(str, "%lf", val));
}
{
return (1 == sscanf(str, "%lf", val));
}