diff --git a/apps/example/epwget.c b/apps/example/epwget.c index d0a0ea4..5d0aa84 100644 --- a/apps/example/epwget.c +++ b/apps/example/epwget.c @@ -734,6 +734,9 @@ main(int argc, char **argv) TRACE_CONFIG("CPU limit should be smaller than the " "number of CPUS: %d\n", num_cores); return FALSE; + } else if (core_limit < 1) { + TRACE_CONFIG("CPU limit should be greater than 0\n"); + return FALSE; } /** * it is important that core limit is set diff --git a/mtcp/src/api.c b/mtcp/src/api.c index 64a45a7..20eef13 100644 --- a/mtcp/src/api.c +++ b/mtcp/src/api.c @@ -395,7 +395,7 @@ mtcp_socket(mctx_t mctx, int domain, int type, int protocol) } if (type == SOCK_STREAM) { - type = MTCP_SOCK_STREAM; + type = (int)MTCP_SOCK_STREAM; } else { errno = EINVAL; return -1; diff --git a/util/http_parsing.c b/util/http_parsing.c index 50116b2..a882299 100644 --- a/util/http_parsing.c +++ b/util/http_parsing.c @@ -106,12 +106,10 @@ http_header_str_val(const char* buf, const char *key, const int keylen, } /* copy value data */ - if (temp) { - while (*temp && !CR_OR_NEWLINE(*temp) && i < value_len-1) - value[i++] = *temp++; - value[i] = 0; - } - + while (*temp && !CR_OR_NEWLINE(*temp) && i < value_len-1) + value[i++] = *temp++; + value[i] = 0; + if (i == 0) { *value = 0; return NULL;