packages/utils/mmc-utils/patches/0010-One-further-optimization-of-trimming-routine.patch
Ilya Lipnitskiy 5d8d4fbbcb
treewide: Run refresh on all packages
The crude loop I wrote to come up with this changeset:

  find -L package/feeds/packages/ -name patches | \
  sed 's/patches$/refresh/' | sort | xargs make

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
2021-02-20 16:02:15 -08:00

30 lines
827 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(-)
--- 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 */