diff options
author | Vinson Lee <[email protected]> | 2010-01-03 02:38:22 -0800 |
---|---|---|
committer | Vinson Lee <[email protected]> | 2010-01-03 02:38:22 -0800 |
commit | 1da47ac20e676e05c1b0b66c2c07265836f4c7eb (patch) | |
tree | 369aebc63931c1c3507e49ed6c7c6ef1fdaed86f /progs/vp/vp-tris.c | |
parent | c9c6e9a39e3d38cfc05772667c759b82df8f0fff (diff) |
progs/vp: Ensure null-terminated byte string.
Diffstat (limited to 'progs/vp/vp-tris.c')
-rw-r--r-- | progs/vp/vp-tris.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c index 29cd027b00c..09236c296f7 100644 --- a/progs/vp/vp-tris.c +++ b/progs/vp/vp-tris.c @@ -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); |