summaryrefslogtreecommitdiff
path: root/testing/nTox.c
diff options
context:
space:
mode:
authorKonstantin Kowalski <kostyakow42@gmail.com>2013-07-27 12:10:41 -0400
committerKonstantin Kowalski <kostyakow42@gmail.com>2013-07-27 12:10:41 -0400
commitb3fa1fc8f48aea08da1552d76397e959cd0aa690 (patch)
tree53511a8fffa0c019b7bb6d92815cca2cd5969a6b /testing/nTox.c
parent4edf2207fe1fe41e5ad6a17067eb91bd9fdbaef9 (diff)
[fixed]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.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/testing/nTox.c b/testing/nTox.c
index 27654191..cb38bb9f 100644
--- a/testing/nTox.c
+++ b/testing/nTox.c
@@ -22,6 +22,7 @@
22 */ 22 */
23 23
24#include "nTox.h" 24#include "nTox.h"
25#include "misc_tools.h"
25#include <stdio.h> 26#include <stdio.h>
26#include <time.h> 27#include <time.h>
27#ifdef WIN32 28#ifdef WIN32
@@ -46,21 +47,6 @@ void new_lines(char *line)
46 do_refresh(); 47 do_refresh();
47} 48}
48 49
49//TODO: rewrite
50unsigned 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
64void line_eval(char lines[HISTORY][STRING_LENGTH], char *line) 50void line_eval(char lines[HISTORY][STRING_LENGTH], char *line)
65{ 51{
66 if (line[0] == '/') { 52 if (line[0] == '/') {