aboutsummaryrefslogtreecommitdiff
path: root/src/gnsrecord
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2023-06-01 13:09:08 +0200
committerMartin Schanzenbach <schanzen@gnunet.org>2023-06-01 13:09:08 +0200
commit9f27a1b29d43795c925864e937c61314d144c0a9 (patch)
tree0c5288883bd48aed934ae88ed9c15086c57a7a1e /src/gnsrecord
parent811c040a28b4bbc9d1bdba3fd8458c2b1033983d (diff)
downloadgnunet-9f27a1b29d43795c925864e937c61314d144c0a9.tar.gz
gnunet-9f27a1b29d43795c925864e937c61314d144c0a9.zip
ALL: Use <inttypes.h> to properly handle log format strings.
NEWS: -
Diffstat (limited to 'src/gnsrecord')
-rw-r--r--src/gnsrecord/json_gnsrecord.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gnsrecord/json_gnsrecord.c b/src/gnsrecord/json_gnsrecord.c
index 0725cb1a1..cc96e42fb 100644
--- a/src/gnsrecord/json_gnsrecord.c
+++ b/src/gnsrecord/json_gnsrecord.c
@@ -114,9 +114,9 @@ parse_record (json_t *data, struct GNUNET_GNSRECORD_Data *rd)
114 &shadow); 114 &shadow);
115 if (0 != unpack_state) 115 if (0 != unpack_state)
116 { 116 {
117 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 117 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
118 "Error gnsdata object has a wrong format: `%s'!\n", 118 "Error gnsdata object has a wrong format: `%s'!\n",
119 err.text); 119 err.text);
120 unpack_state = json_unpack_ex (data, 120 unpack_state = json_unpack_ex (data,
121 &err, 121 &err,
122 0, 122 0,
@@ -143,7 +143,9 @@ parse_record (json_t *data, struct GNUNET_GNSRECORD_Data *rd)
143 return GNUNET_SYSERR; 143 return GNUNET_SYSERR;
144 } 144 }
145 rd->expiration_time = abs_exp.abs_value_us; 145 rd->expiration_time = abs_exp.abs_value_us;
146 } else { 146 }
147 else
148 {
147 rd->expiration_time = rel_exp.rel_value_us; 149 rd->expiration_time = rel_exp.rel_value_us;
148 } 150 }
149 rd->record_type = GNUNET_GNSRECORD_typename_to_number (record_type); 151 rd->record_type = GNUNET_GNSRECORD_typename_to_number (record_type);
@@ -336,15 +338,17 @@ GNUNET_GNSRECORD_JSON_from_gnsrecord (const char*rname,
336 rd[i].data_size); 338 rd[i].data_size);
337 record_type_str = GNUNET_GNSRECORD_number_to_typename (rd[i].record_type); 339 record_type_str = GNUNET_GNSRECORD_number_to_typename (rd[i].record_type);
338 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 340 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
339 "Packing %s %s %lu %d\n", 341 "Packing %s %s %" PRIu64 " %d\n",
340 value_str, record_type_str, rd[i].expiration_time, rd[i].flags); 342 value_str, record_type_str, rd[i].expiration_time, rd[i].flags);
341 record = json_pack ("{s:s,s:s,s:I,s:b,s:b,s:b,s:b}", 343 record = json_pack ("{s:s,s:s,s:I,s:b,s:b,s:b,s:b}",
342 GNUNET_JSON_GNSRECORD_VALUE, 344 GNUNET_JSON_GNSRECORD_VALUE,
343 value_str, 345 value_str,
344 GNUNET_JSON_GNSRECORD_TYPE, 346 GNUNET_JSON_GNSRECORD_TYPE,
345 record_type_str, 347 record_type_str,
346 (rd[i].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION) ? 348 (rd[i].flags
347 GNUNET_JSON_GNSRECORD_RELATIVE_EXPIRATION_TIME : GNUNET_JSON_GNSRECORD_ABSOLUTE_EXPIRATION_TIME, 349 & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION) ?
350 GNUNET_JSON_GNSRECORD_RELATIVE_EXPIRATION_TIME :
351 GNUNET_JSON_GNSRECORD_ABSOLUTE_EXPIRATION_TIME,
348 rd[i].expiration_time, 352 rd[i].expiration_time,
349 GNUNET_JSON_GNSRECORD_FLAG_PRIVATE, 353 GNUNET_JSON_GNSRECORD_FLAG_PRIVATE,
350 rd[i].flags & GNUNET_GNSRECORD_RF_PRIVATE, 354 rd[i].flags & GNUNET_GNSRECORD_RF_PRIVATE,