aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChloe Kudryavtsev <code@toast.bunkerlabs.net>2023-05-31 12:17:49 +0200
committerChloe Kudryavtsev <code@toast.bunkerlabs.net>2023-05-31 12:17:49 +0200
commit2882ded344ca952f752657c48f25f82524c758f7 (patch)
tree99069b1ffac779c59bd734b356559fb46ed825b7
parentno longer hardcode the offset in time tostring (diff)
do not panic on invalid tm put field
-rw-r--r--src/tm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tm.c b/src/tm.c
index 9005626..b016bb2 100644
--- a/src/tm.c
+++ b/src/tm.c
@@ -133,7 +133,11 @@ static void jd_tm_put(void *data, Janet key, Janet value) {
ptr++;
}
- janet_panicf("tried to write to invalid field: %v", key);
+ // do not fail in case someone tries to write an invalid field
+ // people may want to write to gmtoff (for example) on a platform where that
+ // doesn't exist, and this should not conditionally fail on some platforms
+ // instead, silently do nothing
+ return;
}
#define MAX_INT_STRLEN 1024