win32compat: fix aacenc_printf() not to write junk characters
[fdkaac.git] / src / compat_win32.c
index 684998e131e1e6fcc3f3fffd8131ca1577cdc9ba..44822816afed5554bec473a6cb3f65ab5f97c5e0 100644 (file)
@@ -31,7 +31,7 @@ int __wgetmainargs(int *, wchar_t ***, wchar_t ***, int, _startupinfo *);
 
 int64_t aacenc_timer(void)
 {
-#if _MSC_VER || HAVE_STRUCT___TIMEB64
+#if HAVE_STRUCT___TIMEB64
     struct __timeb64 tv;
     _ftime64(&tv);
 #else
@@ -157,7 +157,7 @@ int aacenc_fprintf(FILE *fp, const char *fmt, ...)
         codepage_decode_wchar(CP_UTF8, s, &ws);
         free(s);
         fflush(fp);
-        WriteConsoleW(fh, ws, cnt, &nw, 0);
+        WriteConsoleW(fh, ws, wcslen(ws), &nw, 0);
         free(ws);
     }
     return cnt;
This page took 0.009273 seconds and 4 git commands to generate.