diff options
author | George Hazan <george.hazan@gmail.com> | 2013-08-19 19:04:33 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-08-19 19:04:33 +0000 |
commit | 664200e644b45e52c70affa1c036d7366474ae9d (patch) | |
tree | d05be80055dae5be865e2a56c14d7f6d0ad0fa06 /src/modules | |
parent | 857add6ec30c59d98482c21c60e13f8c3adb89e9 (diff) |
core *printf patch
git-svn-id: http://svn.miranda-ng.org/main/trunk@5750 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/netlib/netliblog.cpp | 6 | ||||
-rw-r--r-- | src/modules/utils/openurl.cpp | 9 | ||||
-rw-r--r-- | src/modules/xml/xmlParser.cpp | 2 |
3 files changed, 9 insertions, 8 deletions
diff --git a/src/modules/netlib/netliblog.cpp b/src/modules/netlib/netliblog.cpp index 4f0aecff29..857f5c75d0 100644 --- a/src/modules/netlib/netliblog.cpp +++ b/src/modules/netlib/netliblog.cpp @@ -491,13 +491,13 @@ void NetlibDumpData(NetlibConnection *nlc, PBYTE buf, int len, int sent, int fla PBYTE p = buf + line;
pszBuf += wsprintfA(
pszBuf, "%08X: %02X %02X %02X %02X-%02X %02X %02X %02X-%02X %02X %02X %02X-%02X %02X %02X %02X ",
- line, p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15]);
+ line, p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15]); //!!!!!!!!!!
}
else {
- pszBuf += wsprintfA(pszBuf, "%08X: ", line);
+ pszBuf += wsprintfA(pszBuf, "%08X: ", line); //!!!!!!!!!!
// Dump data as hex
for (col = 0; col < colsInLine; col++)
- pszBuf += wsprintfA(pszBuf, "%02X%c", buf[line + col], ((col&3) == 3 && col != 15)?'-':' ');
+ pszBuf += wsprintfA(pszBuf, "%02X%c", buf[line + col], ((col&3) == 3 && col != 15)?'-':' '); //!!!!!!!!!!
// Fill out last line with blanks
for (; col<16; col++) {
lstrcpyA(pszBuf, " ");
diff --git a/src/modules/utils/openurl.cpp b/src/modules/utils/openurl.cpp index 70590c8ebf..b451421441 100644 --- a/src/modules/utils/openurl.cpp +++ b/src/modules/utils/openurl.cpp @@ -37,9 +37,10 @@ static void OpenURLThread(void *arg) return;
//wack a protocol on it
- TCHAR *szResult = (TCHAR*)mir_alloc(sizeof(TCHAR)*(lstrlen(hUrlInfo->szUrl)+9));
+ size_t size = lstrlen(hUrlInfo->szUrl)+9;
+ TCHAR *szResult = (TCHAR*)mir_alloc(sizeof(TCHAR)*size);
if ((isalpha(hUrlInfo->szUrl[0]) && hUrlInfo->szUrl[1] == ':') || hUrlInfo->szUrl[0] == '\\') {
- wsprintf(szResult, _T("file:///%s"), hUrlInfo->szUrl);
+ mir_sntprintf(szResult, size, _T("file:///%s"), hUrlInfo->szUrl);
}
else {
int i;
@@ -48,9 +49,9 @@ static void OpenURLThread(void *arg) szResult = mir_tstrdup(hUrlInfo->szUrl);
else {
if ( !_tcsnicmp(hUrlInfo->szUrl, _T("ftp."), 4))
- wsprintf(szResult, _T("ftp://%s"), hUrlInfo->szUrl);
+ mir_sntprintf(szResult, size, _T("ftp://%s"), hUrlInfo->szUrl);
else
- wsprintf(szResult, _T("http://%s"), hUrlInfo->szUrl);
+ mir_sntprintf(szResult, size, _T("http://%s"), hUrlInfo->szUrl);
}
}
diff --git a/src/modules/xml/xmlParser.cpp b/src/modules/xml/xmlParser.cpp index af3f7d92e1..7407fa908c 100644 --- a/src/modules/xml/xmlParser.cpp +++ b/src/modules/xml/xmlParser.cpp @@ -402,7 +402,7 @@ XMLNode XMLNode::openFileHelper(XMLCSTR filename, XMLCSTR tag) // create message
char message[2000], *s1 = (char*)"", *s3 = (char*)""; XMLCSTR s2 = _CXML("");
if (pResults.error == eXMLErrorFirstTagNotFound) { s1 = (char*)"First Tag should be '"; s2 = tag; s3 = (char*)"'.\n"; }
- sprintf(message,
+ mir_snprintf(message, SIZEOF(message),
#ifdef _XMLWIDECHAR
"XML Parsing error inside file '%S'.\n%S\nAt line %i, column %i.\n%s%S%s"
#else
|