diff options
author | Nicolas Noble <nicolasnoble@users.noreply.github.com> | 2019-07-30 17:49:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-30 17:49:03 -0700 |
commit | 76d75aec66e1e6f173f3b6668601108ed453f3d3 (patch) | |
tree | b4bc5af6bb92804bae676dd32c3b21cdd78972aa /upb/json/printer.c | |
parent | 423ea5ca9ce8da69611e6e95559efcb3a1ba8ad8 (diff) | |
parent | 7a1e6aa84ba857d2e3cdc6e5fd50e3bda210c164 (diff) |
Merge pull request #195 from veblush/vsnprintf
Fix compiler error on Windows
Diffstat (limited to 'upb/json/printer.c')
-rw-r--r-- | upb/json/printer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/upb/json/printer.c b/upb/json/printer.c index 90705a7..38f817d 100644 --- a/upb/json/printer.c +++ b/upb/json/printer.c @@ -181,11 +181,11 @@ const char neginf[] = "\"-Infinity\""; const char inf[] = "\"Infinity\""; static size_t fmt_double(double val, char* buf, size_t length) { - if (val == (1.0 / 0.0)) { + if (val == UPB_INFINITY) { CHKLENGTH(length >= strlen(inf)); strcpy(buf, inf); return strlen(inf); - } else if (val == (-1.0 / 0.0)) { + } else if (val == -UPB_INFINITY) { CHKLENGTH(length >= strlen(neginf)); strcpy(buf, neginf); return strlen(neginf); |