1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-29 06:46:45 +02:00

Lots of bug fixes and general code cleanup

This commit is contained in:
Jfreegman
2015-08-27 03:38:08 -04:00
parent 92d76c7f99
commit 11701d22a1
19 changed files with 247 additions and 173 deletions

View File

@ -41,8 +41,14 @@
void hst_to_net(uint8_t *num, uint16_t numbytes);
/* convert a hex string to binary */
char *hex_string_to_bin(const char *hex_string);
/*
* Converts a hexidecimal string of length hex_len to binary format and puts the result in output.
* output_size must be exactly half of hex_len.
*
* Returns 0 on success.
* Returns -1 on failure.
*/
int hex_string_to_bin(const char *hex_string, size_t hex_len, char *output, size_t output_size);
/* convert a hex string to bytes. returns 0 on success, -1 on failure */
int hex_string_to_bytes(char *buf, int size, const char *keystr);