X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=callerid.c;h=2f12ac184711069752ad1745f625479aee40b511;hp=9b31461c634b9527c7579d757ad4133680632d73;hb=79bd731c0db3e3202cfeed2af3fb217ae744b70f;hpb=6bf7c7f9db360d6031417b012dcb0e90e2251cd6 diff --git a/callerid.c b/callerid.c index 9b31461..2f12ac1 100644 --- a/callerid.c +++ b/callerid.c @@ -45,20 +45,22 @@ const char *numberrize_callerinfo(const char *string, int ntype, const char *nat case INFO_NTYPE_INTERNATIONAL: strcpy(result, international); - strncat(result, string, sizeof(result)-strlen(result)-1); + strncat(result, string, sizeof(result)-1); result[sizeof(result)-1] = '\0'; return(result); break; case INFO_NTYPE_NATIONAL: strcpy(result, national); - strncat(result, string, sizeof(result)-strlen(result)-1); + strncat(result, string, sizeof(result)-1); result[sizeof(result)-1] = '\0'; return(result); break; default: - return(string); + strncpy(result, string, sizeof(result)-1); + result[sizeof(result)-1] = '\0'; + return(result); } }