]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ftepp.c
Make it compile in visual studio again, without warnings.
[xonotic/gmqcc.git] / ftepp.c
diff --git a/ftepp.c b/ftepp.c
index a28bbec862720fa75dacdbb0e0dd9c4a1212a3bb..8edb644f8c44019eeee11f43ee8b6e2f20d39d07 100644 (file)
--- a/ftepp.c
+++ b/ftepp.c
@@ -183,6 +183,9 @@ static char *ftepp_predef_timestamp(lex_file *context) {
     char       *find;
     char       *value;
     size_t      size;
+#ifdef _MSC_VER
+       char        buffer[64];
+#endif
     if (stat(context->name, &finfo))
         return util_strdup("\"<failed to determine timestamp>\"");
 
@@ -190,7 +193,14 @@ static char *ftepp_predef_timestamp(lex_file *context) {
      * ctime and its fucking annoying newline char, no worries, we're
      * professionals here.
      */
+
+#ifndef _MSC_VER
     find  = ctime(&finfo.st_mtime);
+#else
+       ctime_s(buffer, sizeof(buffer), &finfo.st_mtime);
+       find = buffer;
+#endif
+
     value = (char*)mem_a(strlen(find) + 1);
     memcpy(&value[1], find, (size = strlen(find)) - 1);