From 7bfb16e0da721dcf50558f9104d3ed84efe03516 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Sun, 16 Nov 2025 14:26:41 +0100 Subject: Implement replacement functions for executing commands This commit implements replacement functions for the previous exec functions. The replacements are implemented in a more "pure" style, the do no longer receive pointer arguments which they will write to, but create the pointers themselves and should therefore be easier to use, since it is more obvious what goes in and what comes out. Also a essentialy unused variable was removed with this. --- plugins/runcmd.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'plugins/runcmd.c') diff --git a/plugins/runcmd.c b/plugins/runcmd.c index 7c583b85..be6691d2 100644 --- a/plugins/runcmd.c +++ b/plugins/runcmd.c @@ -300,7 +300,6 @@ static int np_fetch_output(int fd, output *op, int flags) { } op->line = NULL; - op->lens = NULL; i = 0; while (i < op->buflen) { /* make sure we have enough memory */ @@ -311,7 +310,6 @@ static int np_fetch_output(int fd, output *op, int flags) { } while (!ary_size); op->line = realloc(op->line, ary_size * sizeof(char *)); - op->lens = realloc(op->lens, ary_size * sizeof(size_t)); } /* set the pointer to the string */ @@ -323,9 +321,6 @@ static int np_fetch_output(int fd, output *op, int flags) { } buf[i] = '\0'; - /* calculate the string length using pointer difference */ - op->lens[lineno] = (size_t)&buf[i] - (size_t)op->line[lineno]; - lineno++; i++; } -- cgit v1.2.3-74-g34f1