summaryrefslogtreecommitdiff
path: root/testing/misc_tools.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-08-16 13:11:09 -0400
committerirungentoo <irungentoo@gmail.com>2013-08-16 13:11:09 -0400
commit88ff81d9def5efe69cbaf91aa41906177ba7dde9 (patch)
treecb9f149e438bcd1f18d8c1eb5d8be6b0a22f58a4 /testing/misc_tools.c
parentc5af8f44a9d040a0bbe0442ec074d9fc8562dd32 (diff)
Passed everything through astyle.
Diffstat (limited to 'testing/misc_tools.c')
-rw-r--r--testing/misc_tools.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/testing/misc_tools.c b/testing/misc_tools.c
index f3d6b0ae..7268f3cb 100644
--- a/testing/misc_tools.c
+++ b/testing/misc_tools.c
@@ -1,5 +1,5 @@
1/* misc_tools.c 1/* misc_tools.c
2 * 2 *
3 * Miscellaneous functions and data structures for doing random things. 3 * Miscellaneous functions and data structures for doing random things.
4 * 4 *
5 * Copyright (C) 2013 Tox project All Rights Reserved. 5 * Copyright (C) 2013 Tox project All Rights Reserved.
@@ -18,9 +18,9 @@
18 * 18 *
19 * You should have received a copy of the GNU General Public License 19 * You should have received a copy of the GNU General Public License
20 * along with Tox. If not, see <http://www.gnu.org/licenses/>. 20 * along with Tox. If not, see <http://www.gnu.org/licenses/>.
21 * 21 *
22 */ 22 */
23 23
24#include "misc_tools.h" 24#include "misc_tools.h"
25 25
26#include <string.h> 26#include <string.h>
@@ -32,14 +32,15 @@
32#endif // DEBUG 32#endif // DEBUG
33 33
34/* TODO: rewrite */ 34/* TODO: rewrite */
35unsigned char * hex_string_to_bin(char hex_string[]) 35unsigned char *hex_string_to_bin(char hex_string[])
36{ 36{
37 size_t len = strlen(hex_string); 37 size_t len = strlen(hex_string);
38 unsigned char *val = malloc(len); 38 unsigned char *val = malloc(len);
39 char *pos = hex_string; 39 char *pos = hex_string;
40 int i; 40 int i;
41 for(i = 0; i < len; ++i, pos+=2) 41
42 sscanf(pos,"%2hhx",&val[i]); 42 for (i = 0; i < len; ++i, pos += 2)
43 sscanf(pos, "%2hhx", &val[i]);
43 44
44 return val; 45 return val;
45} 46}