aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc-runserver/httpd.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2016-10-14 00:33:39 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2016-10-14 00:33:39 +0200
commit613f53b44279c44a8f53783d2dc4410584133431 (patch)
tree1f6bb8c959f523682294824681e9131ece27adfd /src/blogc-runserver/httpd.c
parent8664aa16e2df5d94a594785661283a39340db2fd (diff)
downloadblogc-613f53b44279c44a8f53783d2dc4410584133431.tar.gz
blogc-613f53b44279c44a8f53783d2dc4410584133431.tar.bz2
blogc-613f53b44279c44a8f53783d2dc4410584133431.zip
runserver: blogc/loader: improve strto*l handling
Diffstat (limited to 'src/blogc-runserver/httpd.c')
-rw-r--r--src/blogc-runserver/httpd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/blogc-runserver/httpd.c b/src/blogc-runserver/httpd.c
index 195bad0..1312ec9 100644
--- a/src/blogc-runserver/httpd.c
+++ b/src/blogc-runserver/httpd.c
@@ -212,6 +212,11 @@ int
br_httpd_run(const char *host, unsigned short port, const char *docroot,
size_t max_threads)
{
+ if (port == 0) {
+ fprintf(stderr, "Invalid port: 0\n");
+ return 1;
+ }
+
thread_data_t threads[max_threads];
for (size_t i = 0; i < max_threads; i++)
threads[i].initialized = false;