summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
Diffstat (limited to 'strings')
-rw-r--r--strings/decimal.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index 7db5111fc84..029a85b3202 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1000,6 +1000,12 @@ static int ull2dec(ulonglong from, decimal_t *to)
sanity(to);
+ if (!from)
+ {
+ decimal_make_zero(to);
+ return E_DEC_OK;
+ }
+
for (intg1=1; from >= DIG_BASE; intg1++, from/=DIG_BASE) {}
if (unlikely(intg1 > to->len))
{