fix hostname check
authorChristian Grothoff <christian@grothoff.org>
Mon, 16 Apr 2018 11:09:30 +0000 (13:09 +0200)
committerChristian Grothoff <christian@grothoff.org>
Mon, 16 Apr 2018 11:09:30 +0000 (13:09 +0200)
src/namestore/gnunet-zoneimport.c

index 2af63dc3d3ac34dd2d4b448c9b8a394962894847..10d9cb4b640e8a08e8945a247dab832b8f46fa07 100644 (file)
@@ -1117,18 +1117,15 @@ queue (const char *hostname)
     return;
   }
   for (zone = zone_head; NULL != zone; zone = zone->next)
-    if ( (0 == strncmp (zone->domain,
-                        hostname,
-                        dot - hostname)) &&
-         (strlen (zone->domain) == dot - hostname) )
+    if (0 == strcmp (zone->domain,
+                     dot + 1))
       break;
   if (NULL == zone)
   {
     rejects++;
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Domain name `%.*s' not in ego list!\n",
-                (int) (dot - hostname),
-                hostname);
+                "Domain name `%s' not in ego list!\n",
+                dot + 1);
     return;
   }
   q.name = (char *) hostname;