diff --git a/proc/escape.c b/proc/escape.c index 827337fe..82cd6821 100644 --- a/proc/escape.c +++ b/proc/escape.c @@ -217,11 +217,10 @@ int escape_command(char *restrict const outbuf, const proc_t *restrict const pp, if(pp->state=='Z') overhead += 10; // chars in " " else flags &= ~ESC_DEFUNCT; } - if(overhead + 1 >= *cells){ // if no room for even one byte of the command name - // you'd damn well better have _some_ space -// outbuf[0] = '-'; // Oct23 - outbuf[1] = '\0'; - return 1; + if(overhead + 1 >= *cells || // if no room for even one byte of the command name + overhead + 1 >= bytes){ + outbuf[0] = '\0'; + return 0; } if(flags & ESC_BRACKETS){ outbuf[end++] = '[';