]> mj.ucw.cz Git - libucw.git/blobdiff - ucw-json/format.c
UCW::Configure::Perl: Split off configuration of Perl paths
[libucw.git] / ucw-json / format.c
index 30f8757fd799199ad0c47ffd6c99c0de1018768d..227a26b548e7573c399f48b71d6701f15f77915f 100644 (file)
@@ -15,7 +15,6 @@
 #include <ucw-json/json.h>
 
 #include <float.h>
-#include <math.h>
 #include <stdio.h>
 
 void json_set_output(struct json_context *js, struct fastbuf *fb)
@@ -58,7 +57,7 @@ static void write_string(struct json_context *js, const char *p)
          else if (u < 0x110000)
            bprintf(fb, "\\u%04x\\u%04x", 0xd800 + ((u - 0x10000) >> 10), 0xdc00 + (u & 0x3ff));
          else
-           ASSERT(0);
+           bprintf(fb, "\\u%04x", UNI_REPLACEMENT);
        }
       else
        bput_utf8_32(fb, u);
@@ -68,7 +67,6 @@ static void write_string(struct json_context *js, const char *p)
 
 static void write_number(struct fastbuf *fb, double val)
 {
-  ASSERT(isfinite(val));
   bprintf(fb, "%.*g", DBL_DIG+1, val);
 }