mmc-utils: One further optimization of trimming routine

The last change to the trimming routine made it more efficient,
however, we can even get rid of the memmove() as we leave the
function with strdup() anyway.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20210920194633.814-1-mhei@heimpold.de
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
Michael Heimpold authored and Ulf Hansson committed 2021-09-30 11:46:07 +02:00
1 parent 0eea71e4f2
commit 7769a4d7ab
1 file changed
+2 -3
+2 -3
View File
@@ -393,10 +393,9 @@ char *read_file(char *name)
start++;
len--;
}
memmove(line, start, len);
line[len] = '\0';
return strdup(line);
start[len] = '\0';
return strdup(start);
}
/* Hexadecimal string parsing functions */