#endif
#include "strerror.h"
-#include "curl_printf.h"
+
+#define _MPRINTF_REPLACE /* use our functions only */
+#include <curl/mprintf.h>
+
#include "curl_memory.h"
/* The last #include file should be: */
#include "memdebug.h"
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err,
LANG_NEUTRAL, wbuf, sizeof(wbuf)/sizeof(wchar_t), NULL);
- wcstombs(buf, wbuf, max);
+ wcstombs(buf,wbuf,max);
}
#else
/* 'sys_nerr' is the maximum errno number, it is not widely portable */
buf[max] = '\0'; /* make sure the string is zero terminated */
/* strip trailing '\r\n' or '\n'. */
- if((p = strrchr(buf, '\n')) != NULL && (p - buf) >= 2)
+ if((p = strrchr(buf,'\n')) != NULL && (p - buf) >= 2)
*p = '\0';
- if((p = strrchr(buf, '\r')) != NULL && (p - buf) >= 1)
+ if((p = strrchr(buf,'\r')) != NULL && (p - buf) >= 1)
*p = '\0';
if(old_errno != ERRNO)
case SEC_E_OK:
txt = "No error";
break;
- case CRYPT_E_REVOKED:
- txt = "CRYPT_E_REVOKED";
- break;
case SEC_E_ALGORITHM_MISMATCH:
txt = "SEC_E_ALGORITHM_MISMATCH";
break;
if(err == SEC_E_OK)
strncpy(outbuf, txt, outmax);
- else if(err == SEC_E_ILLEGAL_MESSAGE)
- snprintf(outbuf, outmax,
- "SEC_E_ILLEGAL_MESSAGE (0x%04X%04X) - This error usually occurs "
- "when a fatal SSL/TLS alert is received (e.g. handshake failed). "
- "More detail may be available in the Windows System event log.",
- (err >> 16) & 0xffff, err & 0xffff);
else {
str = txtbuf;
snprintf(txtbuf, sizeof(txtbuf), "%s (0x%04X%04X)",
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, err, LANG_NEUTRAL,
wbuf, sizeof(wbuf)/sizeof(wchar_t), NULL)) {
- wcstombs(msgbuf, wbuf, sizeof(msgbuf)-1);
+ wcstombs(msgbuf,wbuf,sizeof(msgbuf)-1);
msg_formatted = TRUE;
}
}
if(msg_formatted) {
msgbuf[sizeof(msgbuf)-1] = '\0';
/* strip trailing '\r\n' or '\n' */
- if((p = strrchr(msgbuf, '\n')) != NULL && (p - msgbuf) >= 2)
+ if((p = strrchr(msgbuf,'\n')) != NULL && (p - msgbuf) >= 2)
*p = '\0';
- if((p = strrchr(msgbuf, '\r')) != NULL && (p - msgbuf) >= 1)
+ if((p = strrchr(msgbuf,'\r')) != NULL && (p - msgbuf) >= 1)
*p = '\0';
msg = msgbuf;
}