Fix json_real_set() to return -1 on error
authorPetri Lehtinen <petri@digip.org>
Thu, 13 Sep 2012 05:46:14 +0000 (08:46 +0300)
committerPetri Lehtinen <petri@digip.org>
Thu, 13 Sep 2012 05:46:56 +0000 (08:46 +0300)
src/value.c

index 8d05d91..547eb5d 100644 (file)
@@ -751,7 +751,7 @@ double json_real_value(const json_t *json)
 int json_real_set(json_t *json, double value)
 {
     if(!json_is_real(json))
-        return 0;
+        return -1;
 
     json_to_real(json)->value = value;