Small fixes.

This commit is contained in:
irungentoo 2014-05-02 15:13:10 -04:00
parent 8e24771fc4
commit aca18f65c3
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98

View File

@ -385,7 +385,7 @@ static int send_data_packet(Net_Crypto *c, int crypt_connection_id, uint8_t *dat
/* Get the lowest 2 bytes from the nonce and convert /* Get the lowest 2 bytes from the nonce and convert
* them to host byte format before returning them. * them to host byte format before returning them.
*/ */
uint16_t get_nonce_uint16(uint8_t *nonce) static uint16_t get_nonce_uint16(uint8_t *nonce)
{ {
uint16_t num; uint16_t num;
memcpy(&num, nonce + (crypto_box_NONCEBYTES - sizeof(uint16_t)), sizeof(uint16_t)); memcpy(&num, nonce + (crypto_box_NONCEBYTES - sizeof(uint16_t)), sizeof(uint16_t));
@ -618,7 +618,7 @@ static int create_crypto_connection(Net_Crypto *c)
{ {
uint32_t i; uint32_t i;
for (i = 0; i <= c->crypto_connections_length; ++i) { for (i = 0; i < c->crypto_connections_length; ++i) {
if (c->crypto_connections[i].status == CRYPTO_CONN_NO_CONNECTION) if (c->crypto_connections[i].status == CRYPTO_CONN_NO_CONNECTION)
return i; return i;
} }