Skip to content

Commit

Permalink
Assing bytes directly
Browse files Browse the repository at this point in the history
  • Loading branch information
matricali committed Nov 28, 2019
1 parent c6076d6 commit 6730e9e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ void zk_server_process_request(zk_server_connection_t cli_conn)
ret = zk_server_read(cli_conn, buffer, BUFSIZE);
i = 0;

uint8_t protocol = buffer[i++];
uint8_t command = buffer[i++];
uint8_t rsv = buffer[i++];
uint8_t atyp = buffer[i++];
uint8_t protocol = buffer[0];
uint8_t command = buffer[1];
uint8_t rsv = buffer[2];
uint8_t atyp = buffer[3];

if (protocol != 0x05) {
zk_logger(ZK_LOG_INFO, "Unsuported protocol version (%02x)\n", protocol);
Expand Down

0 comments on commit 6730e9e

Please sign in to comment.