Skip to content

Commit

Permalink
tftp.c (rx_callback): simplify expressions containing unnecessary casts
Browse files Browse the repository at this point in the history
  • Loading branch information
wpwrak authored and Sebastien Bourdeauducq committed Apr 16, 2013
1 parent 36613c7 commit e0e447f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions software/bios/tftp.c
Expand Up @@ -55,8 +55,8 @@ static void rx_callback(unsigned int src_ip, unsigned short src_port,

if(length < 4) return;
if(dst_port != PORT_IN) return;
opcode = ((unsigned short)(data[0]) << 8)|((unsigned short)(data[1]));
block = ((unsigned short)(data[2]) << 8)|((unsigned short)(data[3]));
opcode = data[0] << 8 | data[1];
block = data[2] << 8 | data[3];
if(block < 1) return;
if(opcode == TFTP_DATA) { /* Data */
length -= 4;
Expand Down

0 comments on commit e0e447f

Please sign in to comment.