Skip to content

Commit

Permalink
Various minor cleanups in net_crypto.
Browse files Browse the repository at this point in the history
* Consistently use `num_packets_array` to get the packet count in the
  packet buffer.
* Use `const` in more places.
* Typo fix: begginning.
* Rewrite `length < 1` for unsigned int to `length == 0`.
* Limit scope of some loop variables by using for-init-decl.
* Use early return in error paths to reduce indentation and for clarity.
* Use `net_unpack_*` instead of manual `ntohs`.
* Fix an uninitialised stack variable copy.
* Fix a potential null pointer dereference.
* Consistently use `get_crypto_connection`. It was inlined in some
  places. I de-inlined it now.
* Add Loggers to some functions in preparation for adding log statements.
  • Loading branch information
iphydf committed Jun 28, 2018
1 parent 4e3bfac commit ac27528
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 125 deletions.
Loading

0 comments on commit ac27528

Please sign in to comment.