]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - msvc.c
Fix memory dump console printing alignment and also trace expressions for allocations.
[xonotic/gmqcc.git] / msvc.c
diff --git a/msvc.c b/msvc.c
index d1273c670ee9da51203378019d87e9b5f2efc6a2..77afc1056ee407d0cdca27d1a0e4994abb9644a7 100644 (file)
--- a/msvc.c
+++ b/msvc.c
@@ -52,7 +52,7 @@ static void *platform_mem_allocate(size_t bytes) {
 }
 
 int platform_vsnprintf(char *buffer, size_t bytes, const char *format, va_list arg) {
-    vsnprintf_s(buffer, bytes, bytes, format, arg);
+    return vsnprintf_s(buffer, bytes, bytes, format, arg);
 }
 
 int platform_vsscanf(const char *str, const char *format, va_list va) {
@@ -80,7 +80,7 @@ const char *platform_tmpnam(char *str) {
     return tmpnam_s(str, L_tmpnam);
 }
 
-const char *platform_getenv(char *var) {
+const char *platform_getenv(const char *var) {
     char  *buffer = (char *)platform_mem_allocate(GETENV_BUFFER);
     size_t size;
     getenv_s(&size, buffer, GETENV_BUFFER, var);
@@ -231,5 +231,5 @@ struct dirent *platform_readdir(DIR *dir) {
 }
 
 int platform_istty(int fd) {
-    return _istty(fd);
+    return _isatty(fd);
 }