diff options
author | George Hazan <george.hazan@gmail.com> | 2015-05-29 21:34:40 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-05-29 21:34:40 +0000 |
commit | 33d765917eabeb4b664c1b0681d52185920def72 (patch) | |
tree | 2c9e2a65aca18a034daada72599fc6531adae7e1 /protocols/Gadu-Gadu/src/services.cpp | |
parent | a66281d8453edde56145e032e8d38db91580ba08 (diff) |
no more mir_strncat in GG
git-svn-id: http://svn.miranda-ng.org/main/trunk@13901 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Gadu-Gadu/src/services.cpp')
-rw-r--r-- | protocols/Gadu-Gadu/src/services.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp index d0f442d872..5b1a2537f9 100644 --- a/protocols/Gadu-Gadu/src/services.cpp +++ b/protocols/Gadu-Gadu/src/services.cpp @@ -27,23 +27,22 @@ char *gg_status2db(int status, const char *suffix)
{
char *prefix;
- static char str[64];
-
switch(status) {
- case ID_STATUS_AWAY: prefix = "Away"; break;
- case ID_STATUS_NA: prefix = "Na"; break;
- case ID_STATUS_DND: prefix = "Dnd"; break;
- case ID_STATUS_OCCUPIED: prefix = "Occupied"; break;
- case ID_STATUS_FREECHAT: prefix = "FreeChat"; break;
- case ID_STATUS_ONLINE: prefix = "On"; break;
- case ID_STATUS_OFFLINE: prefix = "Off"; break;
- case ID_STATUS_INVISIBLE: prefix = "Inv"; break;
- case ID_STATUS_ONTHEPHONE: prefix = "Otp"; break;
- case ID_STATUS_OUTTOLUNCH: prefix = "Otl"; break;
+ case ID_STATUS_AWAY: prefix = "Away"; break;
+ case ID_STATUS_NA: prefix = "Na"; break;
+ case ID_STATUS_DND: prefix = "Dnd"; break;
+ case ID_STATUS_OCCUPIED: prefix = "Occupied"; break;
+ case ID_STATUS_FREECHAT: prefix = "FreeChat"; break;
+ case ID_STATUS_ONLINE: prefix = "On"; break;
+ case ID_STATUS_OFFLINE: prefix = "Off"; break;
+ case ID_STATUS_INVISIBLE: prefix = "Inv"; break;
+ case ID_STATUS_ONTHEPHONE: prefix = "Otp"; break;
+ case ID_STATUS_OUTTOLUNCH: prefix = "Otl"; break;
default: return NULL;
}
- strncpy(str, prefix, sizeof(str));
- mir_strncat(str, suffix, sizeof(str) - mir_strlen(str));
+
+ static char str[64];
+ mir_snprintf(str, _countof(str), "%s%s", prefix, suffix);
return str;
}
|