summaryrefslogtreecommitdiff
path: root/protocols/Tlen/src/tlen_xml.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2015-05-23 17:49:58 +0000
committerKirill Volinsky <mataes2007@gmail.com>2015-05-23 17:49:58 +0000
commit6fcfba2c46a456677b5825a899469ba4e8905448 (patch)
treeb4b6f6f9001b8609998a815ec1c7c92aa30b287e /protocols/Tlen/src/tlen_xml.cpp
parent24bed968f1e96aa4598d8dbe3a6e8a34dded3dc2 (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/Tlen/src/tlen_xml.cpp')
-rw-r--r--protocols/Tlen/src/tlen_xml.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/protocols/Tlen/src/tlen_xml.cpp b/protocols/Tlen/src/tlen_xml.cpp
index 408df2ab3a..5939c65d58 100644
--- a/protocols/Tlen/src/tlen_xml.cpp
+++ b/protocols/Tlen/src/tlen_xml.cpp
@@ -126,18 +126,18 @@ int TlenXmlParse(XmlState *xmlState, char *buffer, int datalen)
}
else {
if (*(p+1) == '/') { // closing tag
- strncpy(tag, p+2, r-(p+2));
+ mir_strncpy(tag, p+2, r-(p+2));
tag[r-(p+2)] = '\0';
elemType = ELEM_CLOSE;
}
else {
if (*(r-1) == '/') { // single open/close tag
- strncpy(tag, p+1, r-(p+1)-1);
+ mir_strncpy(tag, p+1, r-(p+1)-1);
tag[r-(p+1)-1] = '\0';
elemType = ELEM_OPENCLOSE;
}
else {
- strncpy(tag, p+1, r-(p+1));
+ mir_strncpy(tag, p+1, r-(p+1));
tag[r-(p+1)] = '\0';
elemType = ELEM_OPEN;
}
@@ -147,7 +147,7 @@ int TlenXmlParse(XmlState *xmlState, char *buffer, int datalen)
// TlenLog("ATTR_MAX_LEN too small, ignore current tag");
}
else {
- strncpy(attr, r, q-r);
+ mir_strncpy(attr, r, q-r);
if ((q-r)>0 && attr[q-r-1] == '/') {
attr[q-r-1] = '\0';
elemType = ELEM_OPENCLOSE;
@@ -171,7 +171,7 @@ int TlenXmlParse(XmlState *xmlState, char *buffer, int datalen)
for (q=p+1; q<eob && *q != '<'; q++);
if (q < eob) { // found starting bracket of the next element
str = (char *) mir_alloc(q-p+1);
- strncpy(str, p, q-p);
+ mir_strncpy(str, p, q-p);
str[q-p] = '\0';
TlenXmlProcessElem(xmlState, ELEM_TEXT, str, NULL);
mir_free(str);
@@ -220,7 +220,7 @@ static void TlenXmlParseAttr(XmlNode *node, char *text)
if (*p == '\0') {
a->name = (char *) mir_alloc(klen+1);
- strncpy(a->name, kstart, klen);
+ mir_strncpy(a->name, kstart, klen);
a->name[klen] = '\0';
a->value = mir_strdup("");
break;
@@ -228,7 +228,7 @@ static void TlenXmlParseAttr(XmlNode *node, char *text)
if (*p != '=') {
a->name = (char *) mir_alloc(klen+1);
- strncpy(a->name, kstart, klen);
+ mir_strncpy(a->name, kstart, klen);
a->name[klen] = '\0';
a->value = mir_strdup("");
continue;
@@ -242,7 +242,7 @@ static void TlenXmlParseAttr(XmlNode *node, char *text)
if (*p == '\0') {
a->name = (char *) mir_alloc(klen+1);
- strncpy(a->name, kstart, klen);
+ mir_strncpy(a->name, kstart, klen);
a->name[klen] = '\0';
a->value = mir_strdup("");
break;
@@ -263,10 +263,10 @@ static void TlenXmlParseAttr(XmlNode *node, char *text)
}
a->name = (char *) mir_alloc(klen+1);
- strncpy(a->name, kstart, klen);
+ mir_strncpy(a->name, kstart, klen);
a->name[klen] = '\0';
a->value = (char *) mir_alloc(vlen+1);
- strncpy(a->value, vstart, vlen);
+ mir_strncpy(a->value, vstart, vlen);
a->value[vlen] = '\0';
}
}