diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index b736c6ae0..ef1a6ea0a 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -2436,7 +2436,7 @@ static void drmSIGIOHandler(int interrupt, void *closure) #if 0 fprintf(stderr, "Trying %d\n", entry->fd); #endif - if ((count = read(entry->fd, buf, sizeof(buf))) > 0) { + if ((count = read(entry->fd, buf, sizeof(buf) - 1)) > 0) { buf[count] = '\0'; #if 0 fprintf(stderr, "Got %s\n", buf);