1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-17 21:03:56 +02:00
openwrt-packages/utils/mmc-utils/patches/0010-One-further-optimization-of-trimming-routine.patch
Michael Heimpold 7c5ea5841e mmc-utils: update to latest git head
Remove already upstreamed patches, add another one from mailing-list.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
2019-10-15 21:35:34 +02:00

36 lines
900 B
Diff

From 3539243dcab7b84bb8a45e2c2da80e162284bffc Mon Sep 17 00:00:00 2001
From: Michael Heimpold <mhei@heimpold.de>
Date: Sat, 8 Dec 2018 10:43:01 +0100
Subject: [PATCH] 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>
---
lsmmc.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lsmmc.c b/lsmmc.c
index 06cc0b8..05d59e8 100644
--- a/lsmmc.c
+++ b/lsmmc.c
@@ -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 */
--
2.17.1