commit 74608a02e60f1b51198c45af40e9420ffdd2e2fb
parent ee8199bb3715752be7fe9ddf8b4a1108086d3504
Author: Christian Grothoff <christian@grothoff.org>
Date: Sat, 9 Dec 2017 23:59:46 +0100
handle localtime() failure
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_proposal.c b/src/backend/taler-merchant-httpd_proposal.c
@@ -171,7 +171,12 @@ proposal_put (struct MHD_Connection *connection,
time (&timer);
tm_info = localtime (&timer);
-
+ if (NULL == tm_info)
+ {
+ return TMH_RESPONSE_reply_internal_error (connection,
+ TALER_EC_PROPOSAL_NO_LOCALTIME,
+ "failed to determine local time");
+ }
off = strftime (buf,
sizeof (buf),
"%H:%M:%S",
@@ -254,7 +259,7 @@ proposal_put (struct MHD_Connection *connection,
if (GNUNET_SYSERR == res)
{
return TMH_RESPONSE_reply_internal_error (connection,
- TALER_EC_NONE,
+ TALER_EC_PROPOSAL_ORDER_PARSE_ERROR,
"Impossible to parse the order");
}