diff --git a/core/include/dap_strfuncs.h b/core/include/dap_strfuncs.h index 9ae03f4f3538732237d35876f76988f909bfc328..c00e70bbdcd904a6efd6029da1fbe5023f98896c 100755 --- a/core/include/dap_strfuncs.h +++ b/core/include/dap_strfuncs.h @@ -39,7 +39,7 @@ DAP_PRINTF_ATTR(1, 2) char *dap_strdup_printf(const char *a_format, ...); char *dap_strncpy(char *a_dst, const char *a_src, size_t a_limit); char* dap_stpcpy(char *a_dest, const char *a_src); char* dap_strstr_len(const char *a_haystack, ssize_t a_haystack_len, const char *a_needle); -char* const dap_str_find(const char **a_str_array, const char *a_str); +const char* dap_str_find(const char **a_str_array, const char *a_str); // concatenates all of str_array's strings, sliding in an optional separator, the returned string is newly allocated. char* dap_strjoinv(const char *a_separator, char **a_str_array); char *dap_strjoin(const char *a_separator, ...); diff --git a/core/src/dap_strfuncs.c b/core/src/dap_strfuncs.c index c4f33e74b02197421225bbf931577b8bc2c3e0fb..213c000149f6b3d9ce6e80747eab1e20a5562413 100755 --- a/core/src/dap_strfuncs.c +++ b/core/src/dap_strfuncs.c @@ -523,12 +523,12 @@ char* dap_strjoinv(const char *a_separator, char **a_str_array) return l_string; } -char* const dap_str_find(const char **a_str_array, const char *a_str) { +const char* dap_str_find(const char **a_str_array, const char *a_str) { if (!a_str_array || !a_str) return NULL; for (size_t i = 0; !!a_str_array[i]; ++i) { if ( !dap_strcmp(a_str, a_str_array[i]) ) - return a_str_array[i]; + return (const char*)a_str_array[i]; } return NULL; } diff --git a/core/src/dap_time.c b/core/src/dap_time.c index 592f800b76d82846b27c17b9793bec77ca0ac052..fc1108c3884e2707d1673c18343c26a96e669251 100644 --- a/core/src/dap_time.c +++ b/core/src/dap_time.c @@ -189,7 +189,7 @@ dap_time_t dap_time_from_str_simplified(const char *a_time_str) struct tm l_tm = {}; char *ret = strptime(a_time_str, "%y%m%d", &l_tm); if ( !ret || *ret ) - return log_it(L_ERROR, "Invalid timestamp \"%s\", expected simplified string \%y\%m\%d", a_time_str), 0; + return log_it(L_ERROR, "Invalid timestamp \"%s\", expected simplified string \"yy\"mm\"dd", a_time_str), 0; l_tm.tm_sec++; time_t tmp = mktime(&l_tm); return tmp > 0 ? (dap_time_t)tmp : 0; diff --git a/io/dap_server.c b/io/dap_server.c index 9056461b63ce862979b02d5b7a867317de513618..770856a593dcc477ef2b480a54bcd520123aac07 100644 --- a/io/dap_server.c +++ b/io/dap_server.c @@ -368,7 +368,8 @@ static void s_es_server_accept(dap_events_socket_t *a_es_listener, SOCKET a_remo if (( l_server->whitelist ? !!dap_str_find(l_server->whitelist, l_remote_addr_str) : !dap_str_find(l_server->blacklist, l_remote_addr_str) )) - return debug_if(l_server->ext_log, L_INFO, "Connection from %s : %s denied. Dump it"); + return debug_if(l_server->ext_log, L_INFO, "Connection from %s : %s denied. Dump it", + l_remote_addr_str, l_port_str); debug_if(l_server->ext_log, L_INFO, "Connection accepted from %s : %s, socket %"DAP_FORMAT_SOCKET, l_remote_addr_str, l_port_str, a_remote_socket); diff --git a/net/server/cli_server/dap_cli_server.c b/net/server/cli_server/dap_cli_server.c index cb63a7f1d2d0fbb76b9cb3015be2b6338e572416..9c126565e8e98abdbabf0f48672c363c6ab188a5 100644 --- a/net/server/cli_server/dap_cli_server.c +++ b/net/server/cli_server/dap_cli_server.c @@ -71,7 +71,7 @@ static bool s_cli_cmd_exec(void *a_arg); static bool s_allowed_cmd_check(char *a_buf) { enum json_tokener_error jterr; - char *l_method = NULL; + const char *l_method; json_object *jobj = json_tokener_parse_verbose(a_buf, &jterr), *jobj_method = NULL; if ( jterr != json_tokener_success )