diff --git a/src/openvpn/proxy.c b/src/openvpn/proxy.c
index 7101d9f..857bf03 100644
--- a/src/openvpn/proxy.c
+++ b/src/openvpn/proxy.c
@@ -767,7 +767,9 @@
 
                 char get[80];
                 CLEAR(buf2);
-                snprintf(get, sizeof(get), "%%*s NTLM %%%zus", sizeof(buf2) - 1);
+                /* mingw checks calls to the builtin snprintf() with the
+                 * ms_printf archetype, which does not know the 'z' modifier */
+                snprintf(get, sizeof(get), "%%*s NTLM %%%us", (unsigned int)(sizeof(buf2) - 1));
                 nparms = sscanf(buf, get, buf2);
 
                 /* check for "Proxy-Authenticate: NTLM TlRM..." */
