Skip to content

Commit a85d84e

Browse files
committed
Fix some Developer Studio compiler warnings
1 parent 1af322f commit a85d84e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/bench.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# include "getopt.h"
1515
#else
1616
# include <unistd.h>
17-
# include <strings.h>
1817
#endif
1918

2019
#include "zone.h"
@@ -26,6 +25,8 @@
2625
#if _MSC_VER
2726
#define strcasecmp(s1, s2) _stricmp(s1, s2)
2827
#define strncasecmp(s1, s2, n) _strnicmp(s1, s2, n)
28+
#else
29+
#include <strings.h>
2930
#endif
3031

3132
typedef zone_parser_t parser_t;

src/zone.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,11 @@ static int32_t open_file(
292292
if (file != &parser->first)
293293
includer = parser->file->path;
294294
if(strcmp(file->name, "-") == 0) {
295-
if(!(file->path = strdup(file->name)))
295+
if (!(file->path = malloc(2)))
296296
return ZONE_OUT_OF_MEMORY;
297+
// FIXME: reading from stdin must only be supported for the initial file
298+
file->path[0] = '-';
299+
file->path[1] = '\0';
297300
} else if ((code = resolve_path(includer, file->name, &file->path)))
298301
return (void)close_file(parser, file), code;
299302

0 commit comments

Comments
 (0)