aboutsummaryrefslogtreecommitdiff
path: root/src/gnsrecord
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-06-06 12:31:36 +0000
committerChristian Grothoff <christian@grothoff.org>2014-06-06 12:31:36 +0000
commit9f0c494811d817879fb546d288e8d3e85d543a76 (patch)
treecbb8128fc10ff9c1c3022039201b478dc595be97 /src/gnsrecord
parent68e75622fc7fd103b193a7440215e5b1875643a9 (diff)
downloadgnunet-9f0c494811d817879fb546d288e8d3e85d543a76.tar.gz
gnunet-9f0c494811d817879fb546d288e8d3e85d543a76.zip
-fixes for consistency
Diffstat (limited to 'src/gnsrecord')
-rw-r--r--src/gnsrecord/plugin_gnsrecord_dns.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/gnsrecord/plugin_gnsrecord_dns.c b/src/gnsrecord/plugin_gnsrecord_dns.c
index 8f5907dc4..2f14ba5a9 100644
--- a/src/gnsrecord/plugin_gnsrecord_dns.c
+++ b/src/gnsrecord/plugin_gnsrecord_dns.c
@@ -356,7 +356,7 @@ dns_string_to_value (void *cls,
356 typep = strtok (sdup, " "); 356 typep = strtok (sdup, " ");
357 /* TODO: add typep mnemonic conversion according to RFC 4398 */ 357 /* TODO: add typep mnemonic conversion according to RFC 4398 */
358 if ( (NULL == typep) || 358 if ( (NULL == typep) ||
359 (1 != sscanf (typep, 359 (1 != SSCANF (typep,
360 "%u", 360 "%u",
361 &type)) || 361 &type)) ||
362 (type > UINT16_MAX) ) 362 (type > UINT16_MAX) )
@@ -366,7 +366,7 @@ dns_string_to_value (void *cls,
366 } 366 }
367 keyp = strtok (NULL, " "); 367 keyp = strtok (NULL, " ");
368 if ( (NULL == keyp) || 368 if ( (NULL == keyp) ||
369 (1 != sscanf (keyp, 369 (1 != SSCANF (keyp,
370 "%u", 370 "%u",
371 &key)) || 371 &key)) ||
372 (key > UINT16_MAX) ) 372 (key > UINT16_MAX) )
@@ -441,8 +441,13 @@ dns_string_to_value (void *cls,
441 441
442 if (7 != SSCANF (s, 442 if (7 != SSCANF (s,
443 "rname=%253s mname=%253s %u,%u,%u,%u,%u", 443 "rname=%253s mname=%253s %u,%u,%u,%u,%u",
444 soa_rname, soa_mname, 444 soa_rname,
445 &soa_serial, &soa_refresh, &soa_retry, &soa_expire, &soa_min)) 445 soa_mname,
446 &soa_serial,
447 &soa_refresh,
448 &soa_retry,
449 &soa_expire,
450 &soa_min))
446 { 451 {
447 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 452 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
448 _("Unable to parse SOA record `%s'\n"), 453 _("Unable to parse SOA record `%s'\n"),
@@ -464,9 +469,9 @@ dns_string_to_value (void *cls,
464 &soa)) 469 &soa))
465 { 470 {
466 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 471 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
467 _("Failed to serialize SOA record with mname `%s' and rname `%s'\n"), 472 _("Failed to serialize SOA record with mname `%s' and rname `%s'\n"),
468 soa_mname, 473 soa_mname,
469 soa_rname); 474 soa_rname);
470 return GNUNET_SYSERR; 475 return GNUNET_SYSERR;
471 } 476 }
472 *data_size = off; 477 *data_size = off;
@@ -487,8 +492,8 @@ dns_string_to_value (void *cls,
487 s)) 492 s))
488 { 493 {
489 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 494 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
490 _("Failed to serialize PTR record with value `%s'\n"), 495 _("Failed to serialize PTR record with value `%s'\n"),
491 s); 496 s);
492 return GNUNET_SYSERR; 497 return GNUNET_SYSERR;
493 } 498 }
494 *data_size = off; 499 *data_size = off;
@@ -651,7 +656,7 @@ dns_typename_to_number (void *cls,
651 unsigned int i; 656 unsigned int i;
652 657
653 i=0; 658 i=0;
654 while ( (name_map[i].name != NULL) && 659 while ( (NULL != name_map[i].name) &&
655 (0 != strcasecmp (dns_typename, name_map[i].name)) ) 660 (0 != strcasecmp (dns_typename, name_map[i].name)) )
656 i++; 661 i++;
657 return name_map[i].number; 662 return name_map[i].number;
@@ -672,7 +677,7 @@ dns_number_to_typename (void *cls,
672 unsigned int i; 677 unsigned int i;
673 678
674 i=0; 679 i=0;
675 while ( (name_map[i].name != NULL) && 680 while ( (NULL != name_map[i].name) &&
676 (type != name_map[i].number) ) 681 (type != name_map[i].number) )
677 i++; 682 i++;
678 return name_map[i].name; 683 return name_map[i].name;