Older compilers had struggles expanding strlen(string-literal) to a
constant compile time expression. Thus our code-base used sizeof() - 1
instead.
This has been resolved for years, so let's use the correct function.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/354
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
unsigned int maj, min;
if (strstartswith(value, "devname:"))
- devname = value + sizeof("devname:") - 1;
+ devname = value + strlen("devname:");
else if (sscanf(value, "char-major-%u-%u", &maj, &min) == 2) {
type = 'c';
major = maj;
if (cmd == NULL)
return -ENOMEM;
cmdlen = strlen(cmd);
- varlen = sizeof("$CMDLINE_OPTS") - 1;
+ varlen = strlen("$CMDLINE_OPTS");
while ((p = strstr(cmd, "$CMDLINE_OPTS")) != NULL) {
size_t prefixlen = p - cmd;
size_t suffixlen = cmdlen - prefixlen - varlen;