progs/vp: Ensure null-terminated byte string.

This commit is contained in:
Vinson Lee 2010-01-03 02:38:22 -08:00
parent c9c6e9a39e
commit 1da47ac20e

View file

@ -96,7 +96,8 @@ static void Init( void )
exit(1);
}
sz = (GLuint) fread(buf, 1, sizeof(buf), f);
sz = (GLuint) fread(buf, 1, sizeof(buf) - 1, f);
buf[sizeof(buf) - 1] = '\0';
if (!feof(f)) {
fprintf(stderr, "file too long\n");
fclose(f);