From: Lee Date: Fri, 4 Jan 2019 21:07:04 +0000 (-0500) Subject: fix some cppcheck warnings X-Git-Tag: v_3_0_29~621 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=5cf906c08e7aae99d9821416787a359c03987bcd;ds=inline fix some cppcheck warnings change the typecast to (unsigned long) [cgiedit.c:3196]: (warning) %lu in format string (no. 1) requires 'unsigned long' but the argument type is 'signed long'. [cgiedit.c:3317]: (warning) %lu in format string (no. 1) requires 'unsigned long' but the argument type is 'signed long'. [cgiedit.c:3440]: (warning) %lu in format string (no. 1) requires 'unsigned long' but the argument type is 'signed long'. [cgiedit.c:3551]: (warning) %lu in format string (no. 1) requires 'unsigned long' but the argument type is 'signed long'. [cgiedit.c:3673]: (warning) %lu in format string (no. 1) requires 'unsigned long' but the argument type is 'signed long'. [cgiedit.c:3836]: (warning) %lu in format string (no. 1) requires 'unsigned long' but the argument type is 'signed long'. [cgiedit.c:4025]: (warning) %lu in format string (no. 1) requires 'unsigned long' but the argument type is 'signed long'. --- diff --git a/cgiedit.c b/cgiedit.c index 5c281d0b..88175867 100644 --- a/cgiedit.c +++ b/cgiedit.c @@ -3194,7 +3194,7 @@ jb_err cgi_edit_actions_submit(struct client_state *csp, } snprintf(target, sizeof(target), CGI_PREFIX "edit-actions-list?foo=%lu&f=%u#l%u", - (long) time(NULL), file->identifier, sectionid); + (unsigned long) time(NULL), file->identifier, sectionid); edit_free_file(file); @@ -3315,7 +3315,7 @@ jb_err cgi_edit_actions_url(struct client_state *csp, } snprintf(target, sizeof(target), CGI_PREFIX "edit-actions-list?foo=%lu&f=%u#l%u", - (long) time(NULL), file->identifier, section_start_line_number); + (unsigned long) time(NULL), file->identifier, section_start_line_number); edit_free_file(file); @@ -3438,7 +3438,7 @@ jb_err cgi_edit_actions_add_url(struct client_state *csp, } snprintf(target, sizeof(target), CGI_PREFIX "edit-actions-list?foo=%lu&f=%u#l%u", - (long) time(NULL), file->identifier, sectionid); + (unsigned long) time(NULL), file->identifier, sectionid); edit_free_file(file); @@ -3549,7 +3549,7 @@ jb_err cgi_edit_actions_remove_url(struct client_state *csp, } snprintf(target, sizeof(target), CGI_PREFIX "edit-actions-list?foo=%lu&f=%u#l%u", - (long) time(NULL), file->identifier, section_start_line_number); + (unsigned long) time(NULL), file->identifier, section_start_line_number); edit_free_file(file); @@ -3671,7 +3671,7 @@ jb_err cgi_edit_actions_section_remove(struct client_state *csp, } snprintf(target, sizeof(target), CGI_PREFIX "edit-actions-list?foo=%lu&f=%u", - (long) time(NULL), file->identifier); + (unsigned long) time(NULL), file->identifier); edit_free_file(file); @@ -3834,7 +3834,7 @@ jb_err cgi_edit_actions_section_add(struct client_state *csp, } snprintf(target, sizeof(target), CGI_PREFIX "edit-actions-list?foo=%lu&f=%u", - (long) time(NULL), file->identifier); + (unsigned long) time(NULL), file->identifier); edit_free_file(file); @@ -4023,7 +4023,7 @@ jb_err cgi_edit_actions_section_swap(struct client_state *csp, } /* END if (section1 != section2) */ snprintf(target, sizeof(target), CGI_PREFIX "edit-actions-list?foo=%lu&f=%u", - (long) time(NULL), file->identifier); + (unsigned long) time(NULL), file->identifier); edit_free_file(file);