mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
tftp: silence bad-function-cast warning
The cases this warns about are handled elsewhere, so just use an intermediate variable to silence the warning.
This commit is contained in:
parent
6c7f1f741b
commit
3661c8aeb0
@ -1119,7 +1119,8 @@ static CURLcode tftp_receive_packet(struct connectdata *conn)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* The event is given by the TFTP packet time */
|
/* The event is given by the TFTP packet time */
|
||||||
state->event = (tftp_event_t)getrpacketevent(&state->rpacket);
|
unsigned short event = getrpacketevent(&state->rpacket);
|
||||||
|
state->event = (tftp_event_t)event;
|
||||||
|
|
||||||
switch(state->event) {
|
switch(state->event) {
|
||||||
case TFTP_EVENT_DATA:
|
case TFTP_EVENT_DATA:
|
||||||
@ -1138,9 +1139,12 @@ static CURLcode tftp_receive_packet(struct connectdata *conn)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TFTP_EVENT_ERROR:
|
case TFTP_EVENT_ERROR:
|
||||||
state->error = (tftp_error_t)getrpacketblock(&state->rpacket);
|
{
|
||||||
|
unsigned short error = getrpacketblock(&state->rpacket);
|
||||||
|
state->error = (tftp_error_t)error;
|
||||||
infof(data, "%s\n", (const char *)state->rpacket.data+4);
|
infof(data, "%s\n", (const char *)state->rpacket.data+4);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case TFTP_EVENT_ACK:
|
case TFTP_EVENT_ACK:
|
||||||
break;
|
break;
|
||||||
case TFTP_EVENT_OACK:
|
case TFTP_EVENT_OACK:
|
||||||
|
Loading…
Reference in New Issue
Block a user