Replace strncpy with snprintf where necessary

This commit is contained in:
2021-05-11 22:10:02 +02:00
parent 43c512dc5a
commit 4994b4375b
6 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -106,7 +106,7 @@ int url_decode(const char *str, char *dec, long *size) {
int mime_is_compressible(const char *type) {
if (type == NULL) return 0;
char type_parsed[64];
strncpy(type_parsed, type, sizeof(type_parsed) - 1);
snprintf(type_parsed, sizeof(type_parsed), "%s", type);
char *pos = strchr(type_parsed, ';');
if (pos != NULL) pos[0] = 0;
return