Skip to content

Commit

Permalink
http_get_file: style fixes
Browse files Browse the repository at this point in the history
Besides being ugly, the extra parentheses are idiomatic for
suppressing compiler warnings when we are assigning within a
conditional. We aren't doing that here, and they just
confuse the reader.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
  • Loading branch information
Jeff King authored and Jonathan Nieder committed Sep 30, 2013
1 parent 02a110a commit 3d1fb76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions http.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ static int http_get_file(const char *url, const char *filename, int options)

strbuf_addf(&tmpfile, "%s.temp", filename);
result = fopen(tmpfile.buf, "a");
if (! result) {
if (!result) {
error("Unable to open local file %s", tmpfile.buf);
ret = HTTP_ERROR;
goto cleanup;
Expand All @@ -950,7 +950,7 @@ static int http_get_file(const char *url, const char *filename, int options)
ret = http_request_reauth(url, NULL, result, HTTP_REQUEST_FILE, options);
fclose(result);

if ((ret == HTTP_OK) && move_temp_to_file(tmpfile.buf, filename))
if (ret == HTTP_OK && move_temp_to_file(tmpfile.buf, filename))
ret = HTTP_ERROR;
cleanup:
strbuf_release(&tmpfile);
Expand Down

0 comments on commit 3d1fb76

Please sign in to comment.