Add gcc opimization

This commit is contained in:
2021-05-10 18:12:08 +02:00
parent 3f5eee236d
commit 43c512dc5a
3 changed files with 5 additions and 5 deletions

View File

@ -65,13 +65,13 @@ typedef struct {
typedef struct {
char method[16];
char *uri;
char version[3];
char version[4];
http_hdr hdr;
} http_req;
typedef struct {
const http_status *status;
char version[3];
char version[4];
http_hdr hdr;
} http_res;

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));
strncpy(type_parsed, type, sizeof(type_parsed) - 1);
char *pos = strchr(type_parsed, ';');
if (pos != NULL) pos[0] = 0;
return