From b70ee41c5c3aebd36190aa1508368a9bc287fb21 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 29 Mar 2026 13:23:31 +0100 Subject: hexdump performance test, part 1 spoiler alert: it's slow as molasses part 2 will be presented at a later date (yes, please don't fill 8GB of memory with random data and hexdump it) Signed-off-by: Leah Rowe --- util/libreboot-utils/lib/string.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'util/libreboot-utils/lib/string.c') diff --git a/util/libreboot-utils/lib/string.c b/util/libreboot-utils/lib/string.c index 9adbb120..39b31cb0 100644 --- a/util/libreboot-utils/lib/string.c +++ b/util/libreboot-utils/lib/string.c @@ -179,7 +179,6 @@ scatn(ssize_t sc, const char **sv, size_t max, char **rval) { int saved_errno = errno; - char *final = NULL; char *rcur = NULL; char *rtmp = NULL; @@ -192,7 +191,9 @@ scatn(ssize_t sc, const char **sv, for (i = 0; i < sc; i++) { - if (i == 0) { + if (if_err(sv[i] == NULL, EFAULT)) + goto err; + else if (i == 0) { if (sdup(sv[0], max, &final) < 0) goto err; continue; -- cgit v1.2.1