summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/lib/string.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-29 13:23:31 +0100
committerLeah Rowe <leah@libreboot.org>2026-03-29 13:42:37 +0100
commitb70ee41c5c3aebd36190aa1508368a9bc287fb21 (patch)
treebe51d863129204f269c83a5d0b59f62839c80d3a /util/libreboot-utils/lib/string.c
parentcec3de5c9eacb92e45fcd4ff88998d9b35e38663 (diff)
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 <leah@libreboot.org>
Diffstat (limited to 'util/libreboot-utils/lib/string.c')
-rw-r--r--util/libreboot-utils/lib/string.c5
1 files changed, 3 insertions, 2 deletions
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;