From: Andy Polyakov Date: Sat, 1 Feb 2014 22:27:49 +0000 (+0100) Subject: crypto/cryptlib.c: remove stdio dependency (update from master). X-Git-Tag: OpenSSL_1_0_2-beta1~65 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8087969c5b702c14ff1a1044085374070df01a86;p=openssl crypto/cryptlib.c: remove stdio dependency (update from master). --- diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c index 2903bac2a8..8d16a9e0c8 100644 --- a/crypto/cryptlib.c +++ b/crypto/cryptlib.c @@ -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; }