Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix some warnings in tests/.

Somehow, the previous code could compile and run correctly, without crashing.
  • Loading branch information...
commit 20f3ad9a6e3b333d08596979ef29c50b3687ee49 1 parent 8586641
@Cyp Cyp authored
View
2  tests/maptest.cpp
@@ -24,7 +24,7 @@ int main(int argc, char **argv)
GAMEMAP *map;
char filename[PATH_MAX], *delim;
- fscanf(fp, "%s\n", &filename);
+ fscanf(fp, "%256s\n", filename);
// Strip "/game.map"
delim = strrchr(filename, '/');
View
7 tests/modeltest.c
@@ -25,6 +25,7 @@
#include <errno.h>
#include <stdint.h>
#include <stdbool.h>
+#include <unistd.h>
#ifndef WIN32
#include <stdbool.h>
@@ -124,7 +125,7 @@ static void check_pie(const char *input)
for (j = 0; j < points; j++)
{
double a, b, c;
- num = fscanf(fp, "%f %f %f\n", &a, &b, &c);
+ num = fscanf(fp, "%lf %lf %lf\n", &a, &b, &c);
if (num != 3)
{
fprintf(stderr, "File %s. Bad POINTS entry level %d, number %d.\n", input, level, j);
@@ -198,7 +199,7 @@ static void check_pie(const char *input)
for (k = 0; k < 3; k++)
{
double t, u;
- num = fscanf(fp, "%f %f", &t, &u);
+ num = fscanf(fp, "%lf %lf", &t, &u);
if (num != 2)
{
fprintf(stderr, "File %s. Bad texture coordinate entry level %d, number %d\n", input, level, j);
@@ -244,7 +245,7 @@ int main(int argc, char **argv)
{
char filename[PATH_MAX];
- fscanf(fp, "%s\n", &filename);
+ fscanf(fp, "%256s\n", filename);
printf("Testing model: %s\n", filename);
strcpy(fullpath, datapath);
strcat(fullpath, filename);
View
2  tests/qtscripttest.cpp
@@ -21,7 +21,7 @@ int main(int argc, char **argv)
while (!feof(fp))
{
- fscanf(fp, "%s\n", &filename);
+ fscanf(fp, "%256s\n", filename);
printf("Testing script: %s\n", filename);
strcpy(fullpath, datapath);
strcat(fullpath, filename);
Please sign in to comment.
Something went wrong with that request. Please try again.