aboutsummaryrefslogtreecommitdiff
path: root/src/dns.c
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-11-29 23:54:01 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-11-29 23:54:01 +0100
commit9a8214e0304a1dffe0a321d96d01045cfc34c8e8 (patch)
tree3a92b0f6de06290f6471eb30821faef6ea14bed6 /src/dns.c
parent73ede020c76126e81325fcd8d3e186132db21198 (diff)
downloaddns-9a8214e0304a1dffe0a321d96d01045cfc34c8e8.tar.gz
asdf
Diffstat (limited to 'src/dns.c')
-rw-r--r--src/dns.c6
1 files changed, 3 insertions, 3 deletions
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;