Fix some warnings in tests/.

Somehow, the previous code could compile and run correctly, without crashing.
master
Cyp 2012-10-01 16:41:13 +02:00
parent 858664124d
commit 20f3ad9a6e
3 changed files with 6 additions and 5 deletions

View File

@ -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 File

@ -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 File

@ -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);