#include <errno.h>
#include "treestor.h"
-#ifdef WIN32
+#if defined(__WATCOMC__) || defined(_MSC_VER) || defined(__DJGPP__)
#include <malloc.h>
#else
#include <alloca.h>
{ \
static char scrap[128]; \
char *str; \
- int sz = snprintf(scrap, sizeof scrap, fmt, x); \
+ int sz = sprintf(scrap, fmt, x); \
if(!(str = malloc(sz + 1))) return 0; \
sprintf(str, fmt, x); \
return str; \