From 9cf127b4297b8d0e4f3fd34c264d7b1648bad77f Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 3 May 2024 12:38:39 +0200 Subject: [PATCH] const: suffixes --- tools/lvmcmdline.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c index 66b269538..38e3ce190 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -566,7 +566,7 @@ static int _size_arg(struct cmd_context *cmd __attribute__((unused)), { char *ptr; int i; - static const char *suffixes = "kmgtpebs"; + static const char _suffixes[] = "kmgtpebs"; char *val; double v; uint64_t v_tmp, adjustment; @@ -626,8 +626,8 @@ static int _size_arg(struct cmd_context *cmd __attribute__((unused)), return 0; } } else if (*ptr) { - for (i = strlen(suffixes) - 1; i >= 0; i--) - if (suffixes[i] == tolower((int) *ptr)) + for (i = sizeof(_suffixes) - 1; i >= 0; --i) + if (_suffixes[i] == tolower((int) *ptr)) break; if (i < 0) {