From 77ebbed91b350686a1a14f7f6b054ed38e6a2045 Mon Sep 17 00:00:00 2001 From: Konstantin Kowalski Date: Sat, 27 Jul 2013 10:53:01 -0400 Subject: created new files misc_tools.(c|h) and moved hex_string_to_bin() there. --- testing/nTox.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'testing/nTox.c') 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 @@ */ #include "nTox.h" +#include "../core/misc_tools.h" #include #include #ifdef WIN32 @@ -46,21 +47,6 @@ void new_lines(char *line) do_refresh(); } -//TODO: rewrite -unsigned char * hex_string_to_bin(char hex_string[]) -{ - size_t len = strlen(hex_string); - unsigned char * val = malloc(len); - char * pos = hex_string; - int i=0; - while(i < len) { - sscanf(pos,"%2hhx",&val[i]); - pos+=2; - i++; - } - return val; -} - void line_eval(char lines[HISTORY][STRING_LENGTH], char *line) { if (line[0] == '/') { -- cgit v1.2.3