summaryrefslogtreecommitdiff
path: root/testing/misc_tools.c
diff options
context:
space:
mode:
authorAnony Moose <noMail@nomail.su>2013-08-29 22:54:54 +0000
committerAnony Moose <noMail@nomail.su>2013-08-29 22:54:54 +0000
commiteb33796e58cfca4fa26b459ad5a9d013f1df4c42 (patch)
tree6c7fd1cb36376580d667719b12e85634590cd54b /testing/misc_tools.c
parent31354d80d40270ee415b84e312f91b47bf104afe (diff)
Moved misc_tools from testing to toxcore.
Diffstat (limited to 'testing/misc_tools.c')
-rw-r--r--testing/misc_tools.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/testing/misc_tools.c b/testing/misc_tools.c
deleted file mode 100644
index 7268f3cb..00000000
--- a/testing/misc_tools.c
+++ /dev/null
@@ -1,46 +0,0 @@
1/* misc_tools.c
2 *
3 * Miscellaneous functions and data structures for doing random things.
4 *
5 * Copyright (C) 2013 Tox project All Rights Reserved.
6 *
7 * This file is part of Tox.
8 *
9 * Tox is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * Tox is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
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/>.
21 *
22 */
23
24#include "misc_tools.h"
25
26#include <string.h>
27#include <stdlib.h>
28#include <stdio.h>
29
30#ifdef DEBUG
31#include <assert.h>
32#endif // DEBUG
33
34/* TODO: rewrite */
35unsigned char *hex_string_to_bin(char hex_string[])
36{
37 size_t len = strlen(hex_string);
38 unsigned char *val = malloc(len);
39 char *pos = hex_string;
40 int i;
41
42 for (i = 0; i < len; ++i, pos += 2)
43 sscanf(pos, "%2hhx", &val[i]);
44
45 return val;
46}