summaryrefslogtreecommitdiff
path: root/src/misc1.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc1.c')
-rw-r--r--src/misc1.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/misc1.c b/src/misc1.c
index 11f456b80..fd5d1fda8 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -10890,8 +10890,8 @@ get_cmd_output(cmd, infile, flags)
{
/* Change NUL into SOH, otherwise the string is truncated. */
for (i = 0; i < len; ++i)
- if (buffer[len] == NUL)
- buffer[len] = 1;
+ if (buffer[i] == NUL)
+ buffer[i] = 1;
buffer[len] = NUL; /* make sure the buffer is terminated */
}