summaryrefslogtreecommitdiff
path: root/src/webserver.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2015-06-18 13:00:47 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2015-06-18 13:00:47 +0200
commite1da1118b2899ad40793a0a6b06e145899a92ee1 (patch)
tree8f7a31df3b969c4c44e9939f8cc03d8607f38c3c /src/webserver.c
parentbf36ac5be4f855997f90251e92149b3a14300092 (diff)
downloadbiruda-e1da1118b2899ad40793a0a6b06e145899a92ee1.tar.gz
biruda-e1da1118b2899ad40793a0a6b06e145899a92ee1.tar.bz2
automatic /status tab refresh and some 0-byte reminations
Diffstat (limited to 'src/webserver.c')
-rw-r--r--src/webserver.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/webserver.c b/src/webserver.c
index b552ccb..098334a 100644
--- a/src/webserver.c
+++ b/src/webserver.c
@@ -107,12 +107,16 @@ static int handle_request( void *cls, struct MHD_Connection *connection,
} else if( strcmp( url, "/web" ) == 0 ) {
strncpy( biruda_msg, (char *)index_html, index_html_len );
+ biruda_msg[index_html_len] = '\0';
} else if( strcmp( url, "/web/jquery-ui.css" ) == 0 ) {
strncpy( biruda_msg, (char *)jquery_ui_css, jquery_ui_css_len );
+ biruda_msg[jquery_ui_css_len] = '\0';
} else if( strcmp( url, "/web/jquery.js" ) == 0 ) {
strncpy( biruda_msg, (char *)jquery_js, jquery_js_len );
+ biruda_msg[jquery_js_len] = '\0';
} else if( strcmp( url, "/web/jquery-ui.js" ) == 0 ) {
strncpy( biruda_msg, (char *)jquery_ui_js, jquery_ui_js_len );
+ biruda_msg[jquery_ui_js_len] = '\0';
} else {
strcat( biruda_msg, "<html><body><p>This is biruda, the REST api. You can access the web interface <a href=\"/web\">here</a>.</p></body></html>" );
}