projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c9c6e9a
)
progs/vp: Ensure null-terminated byte string.
author
Vinson Lee
<vlee@vmware.com>
Sun, 3 Jan 2010 10:38:22 +0000
(
02:38
-0800)
committer
Vinson Lee
<vlee@vmware.com>
Sun, 3 Jan 2010 10:38:22 +0000
(
02:38
-0800)
progs/vp/vp-tris.c
patch
|
blob
|
history
diff --git
a/progs/vp/vp-tris.c
b/progs/vp/vp-tris.c
index 29cd027b00c2ef70138d0759362b764d0b7161f1..09236c296f7e5f5ec7fbc0e78a961d965f3d560e 100644
(file)
--- 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);