diff options
author | irungentoo <irungentoo@gmail.com> | 2013-07-27 09:32:43 -0700 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-07-27 09:32:43 -0700 |
commit | 8eb76e46a807cfbca1f5b756f6b1955f203617ce (patch) | |
tree | 642769539d9c9c9b5ffded91cbfd44796a12e42c /testing/nTox.c | |
parent | 4edf2207fe1fe41e5ad6a17067eb91bd9fdbaef9 (diff) | |
parent | ecab4c8777ed13405bf97bc2e245800e87afd6a6 (diff) |
Merge pull request #117 from KostyaKow/master
created new files misc_tools.(c|h) and moved hex_string_to_bin() there.
Diffstat (limited to 'testing/nTox.c')
-rw-r--r-- | testing/nTox.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/testing/nTox.c b/testing/nTox.c index 27654191..7ba31110 100644 --- a/testing/nTox.c +++ b/testing/nTox.c | |||
@@ -22,6 +22,8 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include "nTox.h" | 24 | #include "nTox.h" |
25 | #include "misc_tools.h" | ||
26 | |||
25 | #include <stdio.h> | 27 | #include <stdio.h> |
26 | #include <time.h> | 28 | #include <time.h> |
27 | #ifdef WIN32 | 29 | #ifdef WIN32 |
@@ -46,21 +48,6 @@ void new_lines(char *line) | |||
46 | do_refresh(); | 48 | do_refresh(); |
47 | } | 49 | } |
48 | 50 | ||
49 | //TODO: rewrite | ||
50 | unsigned char * hex_string_to_bin(char hex_string[]) | ||
51 | { | ||
52 | size_t len = strlen(hex_string); | ||
53 | unsigned char * val = malloc(len); | ||
54 | char * pos = hex_string; | ||
55 | int i=0; | ||
56 | while(i < len) { | ||
57 | sscanf(pos,"%2hhx",&val[i]); | ||
58 | pos+=2; | ||
59 | i++; | ||
60 | } | ||
61 | return val; | ||
62 | } | ||
63 | |||
64 | void line_eval(char lines[HISTORY][STRING_LENGTH], char *line) | 51 | void line_eval(char lines[HISTORY][STRING_LENGTH], char *line) |
65 | { | 52 | { |
66 | if (line[0] == '/') { | 53 | if (line[0] == '/') { |