events buffer need not end in NUL

This commit is contained in:
rsc 2006-02-21 20:46:49 +00:00
parent c42a1d3d61
commit 95409400f7
3 changed files with 9 additions and 6 deletions

View file

@ -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);