diff options
| author | Dennis <13968467+Decstasy@users.noreply.github.com> | 2025-11-25 15:02:52 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-25 15:02:52 +0100 |
| commit | cedfc166d42f4e89dddc1caa44e0655157d35a0a (patch) | |
| tree | ee980d8df72bc9611099f6a997274831098d4175 /plugins/runcmd.c | |
| parent | 978343ed03d3327597fa3317901f1c1741a7e3c4 (diff) | |
| parent | 3657197cf77ca78f6e2d003a71d48dc5d4dc45ae (diff) | |
| download | monitoring-plugins-cedfc166d42f4e89dddc1caa44e0655157d35a0a.tar.gz | |
Merge branch 'master' into check_dig_flags_feature
Diffstat (limited to 'plugins/runcmd.c')
| -rw-r--r-- | plugins/runcmd.c | 5 |
1 files changed, 0 insertions, 5 deletions
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) { | |||
| 300 | } | 300 | } |
| 301 | 301 | ||
| 302 | op->line = NULL; | 302 | op->line = NULL; |
| 303 | op->lens = NULL; | ||
| 304 | i = 0; | 303 | i = 0; |
| 305 | while (i < op->buflen) { | 304 | while (i < op->buflen) { |
| 306 | /* make sure we have enough memory */ | 305 | /* make sure we have enough memory */ |
| @@ -311,7 +310,6 @@ static int np_fetch_output(int fd, output *op, int flags) { | |||
| 311 | } while (!ary_size); | 310 | } while (!ary_size); |
| 312 | 311 | ||
| 313 | op->line = realloc(op->line, ary_size * sizeof(char *)); | 312 | op->line = realloc(op->line, ary_size * sizeof(char *)); |
| 314 | op->lens = realloc(op->lens, ary_size * sizeof(size_t)); | ||
| 315 | } | 313 | } |
| 316 | 314 | ||
| 317 | /* set the pointer to the string */ | 315 | /* set the pointer to the string */ |
| @@ -323,9 +321,6 @@ static int np_fetch_output(int fd, output *op, int flags) { | |||
| 323 | } | 321 | } |
| 324 | buf[i] = '\0'; | 322 | buf[i] = '\0'; |
| 325 | 323 | ||
| 326 | /* calculate the string length using pointer difference */ | ||
| 327 | op->lens[lineno] = (size_t)&buf[i] - (size_t)op->line[lineno]; | ||
| 328 | |||
| 329 | lineno++; | 324 | lineno++; |
| 330 | i++; | 325 | i++; |
| 331 | } | 326 | } |
