From 53aac8d23a651da1e072dc3b6c445f0b84504ecd Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Tue, 11 Jan 2022 03:18:15 +0000 Subject: [PATCH] Fixed a time int overflow issue on raspberry pi. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3752 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- src/ssb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ssb.c b/src/ssb.c index 618f92d6..1178a792 100644 --- a/src/ssb.c +++ b/src/ssb.c @@ -1135,8 +1135,8 @@ void tf_ssb_append_message(tf_ssb_t* ssb, JSValue message) JS_SetPropertyStr(context, root, "author", authorstr); JS_SetPropertyStr(context, root, "sequence", JS_NewInt64(context, previous_sequence + 1)); - time_t now = time(NULL); - JS_SetPropertyStr(context, root, "timestamp", JS_NewInt64(context, now * 1000)); + int64_t now = (int64_t)time(NULL); + JS_SetPropertyStr(context, root, "timestamp", JS_NewInt64(context, now * 1000LL)); JSValue hashstr = JS_NewString(context, "sha256"); JS_SetPropertyStr(context, root, "hash", hashstr); JSValue content = JS_DupValue(context, message);