Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cppcheck reports: #133

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Fix cppcheck reports:

[tests/libtest/lib1900.c:182]: (style) Array index 'handlenum' is used before limits check.
[docs/examples/sepheaders.c:65]: (error) Resource leak: headerfile
  • Loading branch information...
serval2412 committed Dec 31, 2014
commit b0b7a6e17cf21f6452d1393e2ca424fa6a973162
@@ -62,6 +62,7 @@ int main(void)
bodyfile = fopen(bodyfilename,"wb");
if (bodyfile == NULL) {
curl_easy_cleanup(curl_handle);
fclose(headerfile);
return -1;
}

@@ -179,7 +179,7 @@ int test(char *URL)
now = tutil_tvnow();
msnow = now.tv_sec * 1000 + now.tv_usec / 1000;
mslast = last_handle_add.tv_sec * 1000 + last_handle_add.tv_usec / 1000;
if(msnow - mslast >= urltime[handlenum] && handlenum < num_handles) {
if(handlenum < num_handles && ((msnow - mslast) >= urltime[handlenum])) {
fprintf(stdout, "Adding handle %d\n", handlenum);
setup_handle(URL, m, handlenum);
last_handle_add = now;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.