commit af97b6e59a2af9fe61eda73bbe4c235d917575d5
parent 7d84232c09fc1a49395416eeceb21bd6fcd89958
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 8 Jul 2025 17:43:59 +0200
allow timestamps to be specified with units for more uniformity in the API (some merchant endpoints allowed it)
Diffstat:
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/src/mhd/mhd_parsing.c b/src/mhd/mhd_parsing.c
@@ -224,8 +224,6 @@ TALER_MHD_parse_request_arg_timestamp (
struct GNUNET_TIME_Timestamp *ts)
{
const char *s;
- char dummy;
- unsigned long long t;
s = MHD_lookup_connection_value (connection,
MHD_GET_ARGUMENT_KIND,
@@ -235,11 +233,9 @@ TALER_MHD_parse_request_arg_timestamp (
*ts = GNUNET_TIME_UNIT_ZERO_TS;
return GNUNET_OK;
}
- if (1 !=
- sscanf (s,
- "%llu%c",
- &t,
- &dummy))
+ if (GNUNET_OK !=
+ GNUNET_STRINGS_fancy_time_to_timestamp (s,
+ ts))
{
MHD_RESULT mret;
@@ -253,7 +249,6 @@ TALER_MHD_parse_request_arg_timestamp (
? GNUNET_NO
: GNUNET_SYSERR;
}
- *ts = GNUNET_TIME_timestamp_from_s (t);
return GNUNET_OK;
}