{
case INFO_NTYPE_INTERNATIONAL:
strcpy(result, international);
- strncat(result, string, sizeof(result));
+ strncat(result, string, sizeof(result)-strlen(result)-1);
result[sizeof(result)-1] = '\0';
return(result);
break;
case INFO_NTYPE_NATIONAL:
strcpy(result, national);
- strncat(result, string, sizeof(result));
+ strncat(result, string, sizeof(result)-strlen(result)-1);
result[sizeof(result)-1] = '\0';
return(result);
break;
/* safe strcat/strncat */
-#define SCAT(dst, src) scat(dst, src, sizeof(dst))
+#define SCAT(dst, src) scat(dst, src, sizeof(dst)-strlen(dst)-1)
static inline void scat(char *dst, const char *src, unsigned int siz)
{
strncat(dst, src, siz);