summaryrefslogtreecommitdiff
path: root/lib/tftp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-04-19 10:46:11 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-04-22 09:10:17 +0200
commit063d3f3b96e40b3bf770d04d90612064b9a53c49 (patch)
treedf0a46b661da2352d190a24e4c829ac6052c2a14 /lib/tftp.c
parent19ea52da4df3c3ebc399ae25e705c7a8b5d45d95 (diff)
downloadcurl-063d3f3b96e40b3bf770d04d90612064b9a53c49.tar.gz
tidy-up: make conditional checks more consistent
... remove '== NULL' and '!= 0' Closes #6912
Diffstat (limited to 'lib/tftp.c')
-rw-r--r--lib/tftp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/tftp.c b/lib/tftp.c
index 76d3ff451..ffd7e8a6d 100644
--- a/lib/tftp.c
+++ b/lib/tftp.c
@@ -319,7 +319,7 @@ static CURLcode tftp_parse_option_ack(struct tftp_state_data *state,
const char *option, *value;
tmp = tftp_option_get(tmp, ptr + len - tmp, &option, &value);
- if(tmp == NULL) {
+ if(!tmp) {
failf(data, "Malformed ACK packet, rejecting");
return CURLE_TFTP_ILLEGAL;
}
@@ -776,7 +776,7 @@ static CURLcode tftp_tx(struct tftp_state_data *state, tftp_event_t event)
return result;
state->sbytes += (int)cb;
state->data->req.upload_fromhere += cb;
- } while(state->sbytes < state->blksize && cb != 0);
+ } while(state->sbytes < state->blksize && cb);
sbytes = sendto(state->sockfd, (void *) state->spacket.data,
4 + state->sbytes, SEND_4TH_ARG,
@@ -1256,7 +1256,7 @@ static CURLcode tftp_multi_statemach(struct Curl_easy *data, bool *done)
failf(data, "%s", Curl_strerror(error, buffer, sizeof(buffer)));
state->event = TFTP_EVENT_ERROR;
}
- else if(rc != 0) {
+ else if(rc) {
result = tftp_receive_packet(data);
if(result)
return result;