diff options
| author | 2023-05-31 12:17:49 +0200 | |
|---|---|---|
| committer | 2023-05-31 12:17:49 +0200 | |
| commit | 2882ded344ca952f752657c48f25f82524c758f7 (patch) | |
| tree | 99069b1ffac779c59bd734b356559fb46ed825b7 | |
| parent | no longer hardcode the offset in time tostring (diff) | |
do not panic on invalid tm put field
| -rw-r--r-- | src/tm.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 |
