diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-12-04 14:55:42 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-12-04 14:55:42 +0000 |
commit | 847711205e1ceb7cf4784a4c057ad87ae714f6c4 (patch) | |
tree | 7102bc223cf934bfe37c08a33cd8b3a67d123435 /src/namestore | |
parent | 680f335f4671e64261dd1c23aeda379dd3d23a5b (diff) | |
download | gnunet-847711205e1ceb7cf4784a4c057ad87ae714f6c4.tar.gz gnunet-847711205e1ceb7cf4784a4c057ad87ae714f6c4.zip |
-small fixes:
Diffstat (limited to 'src/namestore')
-rw-r--r-- | src/namestore/namestore_common.c | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/src/namestore/namestore_common.c b/src/namestore/namestore_common.c index 632ca756a..823e09143 100644 --- a/src/namestore/namestore_common.c +++ b/src/namestore/namestore_common.c | |||
@@ -389,18 +389,14 @@ GNUNET_NAMESTORE_value_to_string (uint32_t type, | |||
389 | if (NULL == memchr (soa_mname, 0, | 389 | if (NULL == memchr (soa_mname, 0, |
390 | data_size - (sizeof (struct soa_data) + strlen (soa_rname) + 1))) | 390 | data_size - (sizeof (struct soa_data) + strlen (soa_rname) + 1))) |
391 | return NULL; | 391 | return NULL; |
392 | if (0 == GNUNET_asprintf (&result, | 392 | GNUNET_asprintf (&result, |
393 | "rname=%s mname=%s %lu,%lu,%lu,%lu,%lu", | 393 | "rname=%s mname=%s %lu,%lu,%lu,%lu,%lu", |
394 | soa_rname, soa_mname, | 394 | soa_rname, soa_mname, |
395 | ntohl (soa->serial), | 395 | ntohl (soa->serial), |
396 | ntohl (soa->refresh), | 396 | ntohl (soa->refresh), |
397 | ntohl (soa->retry), | 397 | ntohl (soa->retry), |
398 | ntohl (soa->expire), | 398 | ntohl (soa->expire), |
399 | ntohl (soa->minimum))) | 399 | ntohl (soa->minimum))) |
400 | { | ||
401 | GNUNET_free (result); | ||
402 | return NULL; | ||
403 | } | ||
404 | return result; | 400 | return result; |
405 | case GNUNET_DNSPARSER_TYPE_PTR: | 401 | case GNUNET_DNSPARSER_TYPE_PTR: |
406 | return GNUNET_strndup (data, data_size); | 402 | return GNUNET_strndup (data, data_size); |
@@ -518,14 +514,14 @@ GNUNET_NAMESTORE_string_to_value (uint32_t type, | |||
518 | char soa_mname[253 + 1]; | 514 | char soa_mname[253 + 1]; |
519 | char s_peer[103 + 1]; | 515 | char s_peer[103 + 1]; |
520 | char s_serv[253 + 1]; | 516 | char s_serv[253 + 1]; |
521 | uint32_t soa_serial; | 517 | unsigned int soa_serial; |
522 | uint32_t soa_refresh; | 518 | unsigned int soa_refresh; |
523 | uint32_t soa_retry; | 519 | unsigned int soa_retry; |
524 | uint32_t soa_expire; | 520 | unsigned int soa_expire; |
525 | uint32_t soa_min; | 521 | unsigned int soa_min; |
526 | uint16_t mx_pref; | 522 | uint16_t mx_pref; |
527 | uint16_t mx_pref_n; | 523 | uint16_t mx_pref_n; |
528 | uint16_t proto; | 524 | unsigned int proto; |
529 | 525 | ||
530 | switch (type) | 526 | switch (type) |
531 | { | 527 | { |
@@ -632,7 +628,7 @@ GNUNET_NAMESTORE_string_to_value (uint32_t type, | |||
632 | *data_size = strlen (s); | 628 | *data_size = strlen (s); |
633 | return GNUNET_OK; | 629 | return GNUNET_OK; |
634 | case GNUNET_NAMESTORE_TYPE_VPN: | 630 | case GNUNET_NAMESTORE_TYPE_VPN: |
635 | if (3 != SSCANF (s,"%hu %103s %253s", | 631 | if (3 != SSCANF (s,"%u %103s %253s", |
636 | &proto, s_peer, s_serv)) | 632 | &proto, s_peer, s_serv)) |
637 | { | 633 | { |
638 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 634 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -649,7 +645,7 @@ GNUNET_NAMESTORE_string_to_value (uint32_t type, | |||
649 | *data_size = 0; | 645 | *data_size = 0; |
650 | return GNUNET_SYSERR; | 646 | return GNUNET_SYSERR; |
651 | } | 647 | } |
652 | vpn->proto = htons (proto); | 648 | vpn->proto = htons ((uint16_t) proto); |
653 | strcpy ((char*)&vpn[1], s_serv); | 649 | strcpy ((char*)&vpn[1], s_serv); |
654 | return GNUNET_OK; | 650 | return GNUNET_OK; |
655 | case GNUNET_DNSPARSER_TYPE_TLSA: | 651 | case GNUNET_DNSPARSER_TYPE_TLSA: |