Skip to content

Commit fd162ca

Browse files
committed
fix codacy warnings
1 parent 86d4631 commit fd162ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/webserver.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,7 @@ size_t unescaper_func(void * cls, struct MHD_Connection *c, char *s) {
813813
// IT IS DUE TO A BOGUS ON libmicrohttpd (V0.99) THAT PRODUCING A
814814
// STRING CONTAINING '\0' AFTER AN UNESCAPING, IS UNABLE TO PARSE
815815
// ARGS WITH get_connection_values FUNC OR lookup FUNC.
816+
if (s == nullptr) return 0;
816817
return strlen(s);
817818
}
818819

@@ -1178,7 +1179,7 @@ MHD_Result webserver::finalize_answer(MHD_Connection* connection, struct details
11781179
if (ws_version == nullptr || strcmp(ws_version, "13") != 0) {
11791180
return send_bad_request();
11801181
}
1181-
if (ws_key == nullptr || strlen(ws_key) == 0) {
1182+
if (ws_key == nullptr || ws_key[0] == '\0') {
11821183
return send_bad_request();
11831184
}
11841185

0 commit comments

Comments
 (0)