[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r33575 - gnunet/src/gnsrecord
From: |
gnunet |
Subject: |
[GNUnet-SVN] r33575 - gnunet/src/gnsrecord |
Date: |
Sat, 7 Jun 2014 01:52:35 +0200 |
Author: grothoff
Date: 2014-06-07 01:52:35 +0200 (Sat, 07 Jun 2014)
New Revision: 33575
Modified:
gnunet/src/gnsrecord/plugin_gnsrecord_dns.c
Log:
fix use of %c for ints
Modified: gnunet/src/gnsrecord/plugin_gnsrecord_dns.c
===================================================================
--- gnunet/src/gnsrecord/plugin_gnsrecord_dns.c 2014-06-06 23:52:12 UTC (rev
33574)
+++ gnunet/src/gnsrecord/plugin_gnsrecord_dns.c 2014-06-06 23:52:35 UTC (rev
33575)
@@ -239,10 +239,10 @@
return NULL; /* malformed */
tlsa = data;
if (0 == GNUNET_asprintf (&tlsa_str,
- "%c %c %c %s",
- tlsa->usage,
- tlsa->selector,
- tlsa->matching_type,
+ "%u %u %u %s",
+ (unsigned int) tlsa->usage,
+ (unsigned int) tlsa->selector,
+ (unsigned int) tlsa->matching_type,
(const char *) &tlsa[1]))
{
GNUNET_free (tlsa_str);
@@ -599,22 +599,29 @@
memcpy (*data, &value_aaaa, sizeof (value_aaaa));
return GNUNET_OK;
case GNUNET_DNSPARSER_TYPE_TLSA:
- *data_size = sizeof (struct GNUNET_TUN_DnsTlsaRecord) + strlen (s) - 6;
- *data = tlsa = GNUNET_malloc (*data_size);
- if (4 != SSCANF (s, "%c %c %c %s",
- &tlsa->usage,
- &tlsa->selector,
- &tlsa->matching_type,
- (char*)&tlsa[1]))
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _("Unable to parse TLSA record string `%s'\n"),
- s);
- *data_size = 0;
- GNUNET_free (tlsa);
- return GNUNET_SYSERR;
+ unsigned int usage;
+ unsigned int selector;
+ unsigned int matching_type;
+
+ *data_size = sizeof (struct GNUNET_TUN_DnsTlsaRecord) + strlen (s) - 6;
+ *data = tlsa = GNUNET_malloc (*data_size);
+ if (4 != SSCANF (s,
+ "%u %u %u %s",
+ (char*)&tlsa[1]))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Unable to parse TLSA record string `%s'\n"),
+ s);
+ *data_size = 0;
+ GNUNET_free (tlsa);
+ return GNUNET_SYSERR;
+ }
+ tlsa->usage = (uint8_t) usage;
+ tlsa->selector = (uint8_t) selector;
+ tlsa->matching_type = (uint8_t) matching_type;
+ return GNUNET_OK;
}
- return GNUNET_OK;
default:
return GNUNET_SYSERR;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r33575 - gnunet/src/gnsrecord,
gnunet <=