fix some cppcheck warnings
authorLee <ler762@users.sourceforge.net>
Fri, 4 Jan 2019 21:07:04 +0000 (16:07 -0500)
committerLee <ler762@users.sourceforge.net>
Fri, 4 Jan 2019 21:07:04 +0000 (16:07 -0500)
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'.

cgiedit.c

index 5c281d0..8817586 100644 (file)
--- 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",
    }
 
    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);
 
 
    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",
    }
 
    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);
 
 
    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",
    }
 
    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);
 
 
    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",
    }
 
    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);
 
 
    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",
    }
 
    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);
 
 
    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",
    }
 
    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);
 
 
    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",
    } /* 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);
 
 
    edit_free_file(file);