ensure we don't step past the NUL terminator here.

This commit is contained in:
onyx-and-iris 2024-06-28 01:54:04 +01:00
parent 161b1061c4
commit 49604b874b

View File

@ -192,10 +192,10 @@ void interactive(T_VBVMR_INTERFACE *vmr)
p++; p++;
continue; continue;
} }
i = 0;
log_trace("commands still in buffer: %s", p); log_trace("commands still in buffer: %s", p);
while (!isspace(*p)) i = 0;
while (*p && !isspace(*p))
command[i++] = *p++; command[i++] = *p++;
command[i] = '\0'; command[i] = '\0';
p++; /* shift to next char */ p++; /* shift to next char */