diff --git a/bin/httpsrv b/bin/httpsrv index ff7a87b..4e857f4 100755 Binary files a/bin/httpsrv and b/bin/httpsrv differ diff --git a/lib/log.h b/lib/log.h index e992a98..1bbc3b3 100644 --- a/lib/log.h +++ b/lib/log.h @@ -7,7 +7,7 @@ void info(char* ustr, ...) { char* tstr = GRN "INFO: " CRESET; - char* str = malloc(strlen(tstr) + strlen(ustr)); + char* str = malloc(strlen(tstr) + strlen(ustr) + 1); sprintf(str, "%s%s", tstr, ustr); //strcat(str, ustr); @@ -18,7 +18,7 @@ void info(char* ustr, ...) { void warn(char* ustr, ...) { char* tstr = YEL "WARN: " CRESET; - char* str = malloc(strlen(tstr) + strlen(ustr)); + char* str = malloc(strlen(tstr) + strlen(ustr) + 1); sprintf(str, "%s%s", tstr, ustr); va_list lst; @@ -28,7 +28,7 @@ void warn(char* ustr, ...) { void error(char* ustr, ...) { char* tstr = RED "ERR: " CRESET; - char* str = malloc(strlen(tstr) + strlen(ustr)); + char* str = malloc(strlen(tstr) + strlen(ustr) + 1); sprintf(str, "%s%s", tstr, ustr); va_list lst; @@ -38,7 +38,7 @@ void error(char* ustr, ...) { void reqlog(char* ustr, ...) { char* tstr = WHT "REQ: " CRESET; - char* str = malloc(strlen(tstr) + strlen(ustr)); + char* str = malloc(strlen(tstr) + strlen(ustr) + 1); sprintf(str, "%s%s", tstr, ustr); va_list lst;