summaryrefslogtreecommitdiff
path: root/progs/tests
diff options
context:
space:
mode:
Diffstat (limited to 'progs/tests')
-rw-r--r--progs/tests/getprocaddress.c2
-rw-r--r--progs/tests/vparray.c13
2 files changed, 9 insertions, 6 deletions
diff --git a/progs/tests/getprocaddress.c b/progs/tests/getprocaddress.c
index b905eeaf81..e699baf44b 100644
--- a/progs/tests/getprocaddress.c
+++ b/progs/tests/getprocaddress.c
@@ -1188,7 +1188,7 @@ exercise_buffer_objects(enum Map_Buffer_Usage usage)
GLuint bufferID;
GLint bufferMapped;
static GLubyte data[BUFFER_DATA_SIZE] = {0};
- float *dataPtr;
+ float *dataPtr = NULL;
/* Get the function pointers we need. These are from
* GL_ARB_vertex_buffer_object and are required in all
diff --git a/progs/tests/vparray.c b/progs/tests/vparray.c
index af9b62d33e..fe168c6cd5 100644
--- a/progs/tests/vparray.c
+++ b/progs/tests/vparray.c
@@ -37,13 +37,16 @@ static void read_surface( char *filename )
}
numverts = 0;
- while (!feof(f) && numverts < MAXVERTS) {
- fscanf( f, "%f %f %f %f %f %f",
- &data[numverts][0], &data[numverts][1], &data[numverts][2],
- &data[numverts][3], &data[numverts][4], &data[numverts][5] );
+ while (numverts < MAXVERTS) {
+ int result;
+ result = fscanf( f, "%f %f %f %f %f %f",
+ &data[numverts][0], &data[numverts][1], &data[numverts][2],
+ &data[numverts][3], &data[numverts][4], &data[numverts][5] );
+ if (result == EOF) {
+ break;
+ }
numverts++;
}
- numverts--;
printf("%d vertices, %d triangles\n", numverts, numverts-2);
printf("data = %p\n", (void *) data);