events buffer need not end in NUL
This commit is contained in:
parent
c42a1d3d61
commit
95409400f7
3 changed files with 9 additions and 6 deletions
|
|
@ -679,7 +679,7 @@ winevent(Window *w, char *fmt, ...)
|
|||
if(b == nil)
|
||||
error("vsmprint failed");
|
||||
n = strlen(b);
|
||||
w->events = realloc(w->events, w->nevents+1+n);
|
||||
w->events = erealloc(w->events, w->nevents+1+n);
|
||||
w->events[w->nevents++] = w->owner;
|
||||
memmove(w->events+w->nevents, b, n);
|
||||
free(b);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue