mirror of
https://github.com/lammertb/libhttp.git
synced 2025-09-03 01:21:16 +03:00
Allow port number to be zero to use a random free port.
Keep track of the threads started. Wait for threads to finish when stopping for a clean shutdown. Fix compiler warnings. Fix some issues reported by Coverity static analysis tool. Copyright 2013 F-Secure Corporation.
This commit is contained in:
committed by
Thomas Davis
parent
826328d4d0
commit
fa603909f6
@@ -92,7 +92,7 @@ static void die(const char *fmt, ...)
|
||||
char msg[200];
|
||||
|
||||
va_start(ap, fmt);
|
||||
vsnprintf(msg, sizeof(msg), fmt, ap);
|
||||
(void) vsnprintf(msg, sizeof(msg), fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
#if defined(_WIN32)
|
||||
@@ -176,9 +176,12 @@ static void create_config_file(const char *path)
|
||||
|
||||
static char *sdup(const char *str)
|
||||
{
|
||||
size_t len;
|
||||
char *p;
|
||||
if ((p = (char *) malloc(strlen(str) + 1)) != NULL) {
|
||||
strcpy(p, str);
|
||||
|
||||
len = strlen(str) + 1;
|
||||
if ((p = (char *) malloc(len)) != NULL) {
|
||||
memcpy(p, str, len);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
Reference in New Issue
Block a user