treewide: Run refresh on all packages
[feed/packages.git] / utils / mmc-utils / patches / 0010-One-further-optimization-of-trimming-routine.patch
1 From 3539243dcab7b84bb8a45e2c2da80e162284bffc Mon Sep 17 00:00:00 2001
2 From: Michael Heimpold <mhei@heimpold.de>
3 Date: Sat, 8 Dec 2018 10:43:01 +0100
4 Subject: [PATCH] One further optimization of trimming routine
5
6 The last change to the trimming routine made it more efficient,
7 however, we can even get rid of the memmove() as we leave the
8 function with strdup() anyway.
9
10 Signed-off-by: Michael Heimpold <mhei@heimpold.de>
11 Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
12 ---
13 lsmmc.c | 5 ++---
14 1 file changed, 2 insertions(+), 3 deletions(-)
15
16 --- a/lsmmc.c
17 +++ b/lsmmc.c
18 @@ -393,10 +393,9 @@ char *read_file(char *name)
19 start++;
20 len--;
21 }
22 - memmove(line, start, len);
23 - line[len] = '\0';
24
25 - return strdup(line);
26 + start[len] = '\0';
27 + return strdup(start);
28 }
29
30 /* Hexadecimal string parsing functions */