summaryrefslogtreecommitdiff
path: root/testing/nTox.c
diff options
context:
space:
mode:
authorKonstantin Kowalski <kostyakow42@gmail.com>2013-07-27 10:53:01 -0400
committerKonstantin Kowalski <kostyakow42@gmail.com>2013-07-27 10:53:01 -0400
commit77ebbed91b350686a1a14f7f6b054ed38e6a2045 (patch)
tree3f8216199a9f53dadebfd4d3e49273007d374237 /testing/nTox.c
parent4edf2207fe1fe41e5ad6a17067eb91bd9fdbaef9 (diff)
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..e202a697 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 "../core/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] == '/') {