diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-23 17:49:58 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-23 17:49:58 +0000 |
commit | 6fcfba2c46a456677b5825a899469ba4e8905448 (patch) | |
tree | b4b6f6f9001b8609998a815ec1c7c92aa30b287e /protocols/Gadu-Gadu/src | |
parent | 24bed968f1e96aa4598d8dbe3a6e8a34dded3dc2 (diff) |
replace strncpy to mir_strncpy
git-svn-id: http://svn.miranda-ng.org/main/trunk@13785 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Gadu-Gadu/src')
-rw-r--r-- | protocols/Gadu-Gadu/src/core.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/dynstuff.cpp | 4 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/filetransfer.cpp | 12 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/gg.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/import.cpp | 4 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/services.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/token.cpp | 6 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/userutils.cpp | 2 |
8 files changed, 17 insertions, 17 deletions
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 2bf2907cf4..6d4bfcb17d 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -207,7 +207,7 @@ int gg_decodehosts(char *var, GGHOST *hosts, int max) // Insert new item
hosts[hp].hostname[127] = 0;
- strncpy(hosts[hp].hostname, hostname, 127);
+ mir_strncpy(hosts[hp].hostname, hostname, 127);
hosts[hp].port = portname ? atoi(portname) : 443;
hp ++;
diff --git a/protocols/Gadu-Gadu/src/dynstuff.cpp b/protocols/Gadu-Gadu/src/dynstuff.cpp index 4d21ed7eb0..e84273f6a3 100644 --- a/protocols/Gadu-Gadu/src/dynstuff.cpp +++ b/protocols/Gadu-Gadu/src/dynstuff.cpp @@ -247,7 +247,7 @@ int string_append_n(string_t s, const char *str, int count) string_realloc(s, s->len + count);
s->str[s->len + count] = 0;
- strncpy(s->str + s->len, str, count);
+ mir_strncpy(s->str + s->len, str, count);
s->len += count;
@@ -480,7 +480,7 @@ char **array_make(const char *string, const char *sep, int max, int trim, int qu } else {
for (q = p, len = 0; *q && (last || !strchr(sep, *q)); q++, len++);
token = (char*)calloc(1, len + 1);
- strncpy(token, p, len);
+ mir_strncpy(token, p, len);
token[len] = 0;
p = q;
}
diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp index 3d23d0a9a5..bfa4e99c50 100644 --- a/protocols/Gadu-Gadu/src/filetransfer.cpp +++ b/protocols/Gadu-Gadu/src/filetransfer.cpp @@ -269,7 +269,7 @@ void __cdecl GGPROTO::dccmainthread(void*) {
PROTOFILETRANSFERSTATUS pfts;
local_dcc->tick = tick;
- strncpy(filename, local_dcc->folder, sizeof(filename));
+ mir_strncpy(filename, local_dcc->folder, sizeof(filename));
mir_strncat(filename, (char*)local_dcc->file_info.filename, sizeof(filename) - mir_strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
@@ -300,7 +300,7 @@ void __cdecl GGPROTO::dccmainthread(void*) if (local_dcc->file_fd != -1)
{
PROTOFILETRANSFERSTATUS pfts;
- strncpy(filename, local_dcc->folder, sizeof(filename));
+ mir_strncpy(filename, local_dcc->folder, sizeof(filename));
mir_strncat(filename, (char*)local_dcc->file_info.filename, sizeof(filename) - mir_strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
@@ -499,7 +499,7 @@ void __cdecl GGPROTO::dccmainthread(void*) {
PROTOFILETRANSFERSTATUS pfts;
local_dcc7->tick = tick;
- strncpy(filename, local_dcc7->folder, sizeof(filename));
+ mir_strncpy(filename, local_dcc7->folder, sizeof(filename));
mir_strncat(filename, (char*)local_dcc7->filename, sizeof(filename) - mir_strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
@@ -530,7 +530,7 @@ void __cdecl GGPROTO::dccmainthread(void*) if (local_dcc7->file_fd != -1)
{
PROTOFILETRANSFERSTATUS pfts;
- strncpy(filename, local_dcc7->folder, sizeof(filename));
+ mir_strncpy(filename, local_dcc7->folder, sizeof(filename));
mir_strncat(filename, (char*)local_dcc7->filename, sizeof(filename) - mir_strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
@@ -666,7 +666,7 @@ HANDLE GGPROTO::dccfileallow(HANDLE hTransfer, const PROTOCHAR* szPath) {
struct gg_dcc *dcc = (struct gg_dcc *) hTransfer;
char fileName[MAX_PATH], *path = mir_t2a(szPath);
- strncpy(fileName, path, sizeof(fileName));
+ mir_strncpy(fileName, path, sizeof(fileName));
mir_strncat(fileName, (char*)dcc->file_info.filename, sizeof(fileName) - mir_strlen(fileName));
dcc->folder = _strdup((char *) path);
dcc->tick = 0;
@@ -708,7 +708,7 @@ HANDLE GGPROTO::dcc7fileallow(HANDLE hTransfer, const PROTOCHAR* szPath) struct gg_dcc7 *dcc7 = (struct gg_dcc7 *) hTransfer;
char fileName[MAX_PATH], *path = mir_t2a(szPath);
int iFtRemoveRes;
- strncpy(fileName, path, sizeof(fileName));
+ mir_strncpy(fileName, path, sizeof(fileName));
mir_strncat(fileName, (char*)dcc7->filename, sizeof(fileName) - mir_strlen(fileName));
dcc7->folder = _strdup((char *) path);
dcc7->tick = 0;
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index 45fd51745f..7196ed4b3c 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -436,7 +436,7 @@ void gg_debughandler(int level, const char *format, va_list ap) char *nl = strrchr(szFormat, '\n');
if (nl) *nl = 0;
- strncpy(szText + PREFIXLEN, "[libgadu] \0", sizeof(szText) - PREFIXLEN);
+ mir_strncpy(szText + PREFIXLEN, "[libgadu] \0", sizeof(szText) - PREFIXLEN);
char prefix[6];
mir_snprintf(prefix, SIZEOF(prefix), "%lu", GetCurrentThreadId());
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp index 2ca709ae01..2b903179bb 100644 --- a/protocols/Gadu-Gadu/src/import.cpp +++ b/protocols/Gadu-Gadu/src/import.cpp @@ -119,7 +119,7 @@ char *strndup(char *str, int c) {
char *ret = (char*)malloc(c + 1);
ret[c] = 0;
- strncpy(ret, str, c);
+ mir_strncpy(ret, str, c);
return ret;
}
@@ -174,7 +174,7 @@ void GGPROTO::parsecontacts(char *contacts) if (n && n != p)
{
strPhone = (char*)malloc((n - p) + 5);
- strncpy(strPhone, p, (n - p));
+ mir_strncpy(strPhone, p, (n - p));
mir_strcpy((strPhone + (n - p)), " SMS"); // Add SMS postfix
}
p = (n + 1);
diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp index d0f442d872..09b79b9b44 100644 --- a/protocols/Gadu-Gadu/src/services.cpp +++ b/protocols/Gadu-Gadu/src/services.cpp @@ -42,7 +42,7 @@ char *gg_status2db(int status, const char *suffix) case ID_STATUS_OUTTOLUNCH: prefix = "Otl"; break;
default: return NULL;
}
- strncpy(str, prefix, sizeof(str));
+ mir_strncpy(str, prefix, sizeof(str));
mir_strncat(str, suffix, sizeof(str) - mir_strlen(str));
return str;
}
diff --git a/protocols/Gadu-Gadu/src/token.cpp b/protocols/Gadu-Gadu/src/token.cpp index 2fcf36d31d..85df02f089 100644 --- a/protocols/Gadu-Gadu/src/token.cpp +++ b/protocols/Gadu-Gadu/src/token.cpp @@ -132,7 +132,7 @@ int GGPROTO::gettoken(GGTOKEN *token) }
// Return token id
- strncpy(dat.id, t->tokenid, sizeof(dat.id));
+ mir_strncpy(dat.id, t->tokenid, sizeof(dat.id));
dat.width = t->width;
dat.height = t->height;
@@ -154,8 +154,8 @@ int GGPROTO::gettoken(GGTOKEN *token) return FALSE;
// Fillup patterns
- strncpy(token->id, dat.id, sizeof(token->id));
- strncpy(token->val, dat.val, sizeof(token->val));
+ mir_strncpy(token->id, dat.id, sizeof(token->id));
+ mir_strncpy(token->val, dat.val, sizeof(token->val));
return TRUE;
}
diff --git a/protocols/Gadu-Gadu/src/userutils.cpp b/protocols/Gadu-Gadu/src/userutils.cpp index a5fcae5ee3..1dd223b08a 100644 --- a/protocols/Gadu-Gadu/src/userutils.cpp +++ b/protocols/Gadu-Gadu/src/userutils.cpp @@ -126,7 +126,7 @@ void *gg_dochpass(GGPROTO *gg, uin_t uin, char *password, char *newPass) if (!gg->getString(GG_KEY_EMAIL, &dbv_email))
{
- strncpy(email, dbv_email.pszVal, sizeof(email));
+ mir_strncpy(email, dbv_email.pszVal, sizeof(email));
db_free(&dbv_email);
}
|