aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/gnunet-namestore-zonefile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/namestore/gnunet-namestore-zonefile.c')
-rw-r--r--src/namestore/gnunet-namestore-zonefile.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/namestore/gnunet-namestore-zonefile.c b/src/namestore/gnunet-namestore-zonefile.c
index 26906d140..5cf25abec 100644
--- a/src/namestore/gnunet-namestore-zonefile.c
+++ b/src/namestore/gnunet-namestore-zonefile.c
@@ -271,13 +271,16 @@ parse_origin (char *token, char *origin)
271{ 271{
272 char *next; 272 char *next;
273 next = strchr (token, ';'); 273 next = strchr (token, ';');
274 if (NULL != next) 274 if (NULL == next)
275 next[0] = '\0'; 275 return GNUNET_SYSERR;
276 next[0] = '\0';
276 next = strchr (token, ' '); 277 next = strchr (token, ' ');
277 if (NULL != next) 278 if (NULL == next)
278 next[0] = '\0'; 279 return GNUNET_SYSERR;
280 next[0] = '\0';
279 strcpy (origin, token); 281 strcpy (origin, token);
280 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Origin is: %s\n", origin); 282 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Origin is: %s\n", origin);
283 return GNUNET_OK;
281} 284}
282 285
283static void 286static void
@@ -300,7 +303,6 @@ origin_create_cb (void *cls, const struct GNUNET_IDENTITY_PrivateKey *pk,
300static void 303static void
301origin_lookup_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) 304origin_lookup_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
302{ 305{
303 const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
304 306
305 el = NULL; 307 el = NULL;
306 308
@@ -384,7 +386,7 @@ parse (void *cls)
384 parse_task = NULL; 386 parse_task = NULL;
385 /* use filename provided as 1st argument (stdin by default) */ 387 /* use filename provided as 1st argument (stdin by default) */
386 int ln = 0; 388 int ln = 0;
387 while (res = fgets (buf, sizeof(buf), stdin)) /* read each line of input */ 389 while ((res = fgets (buf, sizeof(buf), stdin))) /* read each line of input */
388 { 390 {
389 ln++; 391 ln++;
390 ttl_line = 0; 392 ttl_line = 0;
@@ -512,7 +514,8 @@ parse (void *cls)
512 if (ZS_READY == state) 514 if (ZS_READY == state)
513 { 515 {
514 fprintf (stderr, 516 fprintf (stderr,
515 _ ("You must provide $ORIGIN in your zonefile or via arguments (--zone)!\n")); 517 _ (
518 "You must provide $ORIGIN in your zonefile or via arguments (--zone)!\n"));
516 ret = 1; 519 ret = 1;
517 GNUNET_SCHEDULER_shutdown (); 520 GNUNET_SCHEDULER_shutdown ();
518 return; 521 return;
@@ -661,10 +664,8 @@ tx_start (void *cls, int32_t success, const char *emsg)
661static void 664static void
662identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) 665identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
663{ 666{
664 const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
665 667
666 el = NULL; 668 el = NULL;
667
668 if (NULL == ego) 669 if (NULL == ego)
669 { 670 {
670 if (NULL != ego_name) 671 if (NULL != ego_name)