summaryrefslogtreecommitdiff
path: root/xs.h
diff options
context:
space:
mode:
Diffstat (limited to 'xs.h')
-rw-r--r--xs.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/xs.h b/xs.h
index 45abfae..bffc0ee 100644
--- a/xs.h
+++ b/xs.h
@@ -737,7 +737,7 @@ double xs_number_get(const char *v)
{
double f = 0.0;
- if (v[0] == XSTYPE_NUMBER)
+ if (v != NULL && v[0] == XSTYPE_NUMBER)
f = atof(&v[1]);
return f;
@@ -749,7 +749,7 @@ const char *xs_number_str(const char *v)
{
const char *p = NULL;
- if (v[0] == XSTYPE_NUMBER)
+ if (v != NULL && v[0] == XSTYPE_NUMBER)
p = &v[1];
return p;