From 9a8214e0304a1dffe0a321d96d01045cfc34c8e8 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Fri, 29 Nov 2019 23:54:01 +0100 Subject: asdf --- src/dns.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/dns.c') diff --git a/src/dns.c b/src/dns.c index 5045e2a..54ad504 100644 --- a/src/dns.c +++ b/src/dns.c @@ -3,7 +3,7 @@ int fqdn_to_qname( char* _source, int _sourcelen, char* _sink ,int _sinklen ) { // TODO Opttimize - int i = 0; + int i; int lastdot = 0; if (_sourcelen < 1 || _sinklen < 1) @@ -11,11 +11,10 @@ int fqdn_to_qname( char* _source, int _sourcelen, char* _sink ,int _sinklen ) _sink[0] = ' '; //Set to known value - while ( (i < _sourcelen) && (i < (_sinklen - 1))) { //Copy offset 1 + for(i = 0; ((i < _sourcelen) && (i < (_sinklen - 1))); i++) { //Copy offset 1 if(! _source[i]) break; _sink[i+1] = _source[i]; - i++; } if( _source[i] ) // _source not terminated @@ -34,6 +33,7 @@ int fqdn_to_qname( char* _source, int _sourcelen, char* _sink ,int _sinklen ) return i+2; } + int qname_to_fqdn( char* _source, int _sourcelen, char* _sink, int _sinklen ) { return -1; -- cgit v1.2.3