mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
const: suffixes
This commit is contained in:
parent
0e5250c475
commit
9cf127b429
@ -566,7 +566,7 @@ static int _size_arg(struct cmd_context *cmd __attribute__((unused)),
|
|||||||
{
|
{
|
||||||
char *ptr;
|
char *ptr;
|
||||||
int i;
|
int i;
|
||||||
static const char *suffixes = "kmgtpebs";
|
static const char _suffixes[] = "kmgtpebs";
|
||||||
char *val;
|
char *val;
|
||||||
double v;
|
double v;
|
||||||
uint64_t v_tmp, adjustment;
|
uint64_t v_tmp, adjustment;
|
||||||
@ -626,8 +626,8 @@ static int _size_arg(struct cmd_context *cmd __attribute__((unused)),
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else if (*ptr) {
|
} else if (*ptr) {
|
||||||
for (i = strlen(suffixes) - 1; i >= 0; i--)
|
for (i = sizeof(_suffixes) - 1; i >= 0; --i)
|
||||||
if (suffixes[i] == tolower((int) *ptr))
|
if (_suffixes[i] == tolower((int) *ptr))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (i < 0) {
|
if (i < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user