]> granicus.if.org Git - openssl/commitdiff
crypto/cryptlib.c: remove stdio dependency (update from master).
authorAndy Polyakov <appro@openssl.org>
Sat, 1 Feb 2014 22:27:49 +0000 (23:27 +0100)
committerAndy Polyakov <appro@openssl.org>
Sat, 1 Feb 2014 22:27:49 +0000 (23:27 +0100)
crypto/cryptlib.c

index 2903bac2a8b87fc6c965ef0eb4767efaf3a13069..8d16a9e0c86aa26f53b62c43d8a32d063a0ca4ca 100644 (file)
@@ -858,8 +858,12 @@ void OPENSSL_showfatal (const char *fmta,...)
     if ((h=GetStdHandle(STD_ERROR_HANDLE)) != NULL &&
        GetFileType(h)!=FILE_TYPE_UNKNOWN)
     {  /* must be console application */
+       int   len;
+       DWORD out;
+
        va_start (ap,fmta);
-       vfprintf (stderr,fmta,ap);
+       len=_vsnprintf((char *)buf,sizeof(buf),fmta,ap);
+       WriteFile(h,buf,len<0?sizeof(buf):(DWORD)len,&out,NULL);
        va_end (ap);
        return;
     }