From 444c12717cd70e1b337c1b171ce1099ae342166f Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 4 Apr 2019 23:45:58 +0200 Subject: [PATCH] clarify --- client/tinycbor/cbortojson.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/client/tinycbor/cbortojson.c b/client/tinycbor/cbortojson.c index 533e6a721..3ea90cee8 100644 --- a/client/tinycbor/cbortojson.c +++ b/client/tinycbor/cbortojson.c @@ -284,8 +284,7 @@ static CborError add_value_metadata(FILE *out, CborType type, const ConversionSt type = flags & FinalTypeMask; flags &= ~(FinalTypeMask | TypeWasTagged); - if (fprintf(out, "\"tag\":\"%" PRIu64 "\"%s", status->lastTag, - flags & ~TypeWasTagged ? "," : "") < 0) + if (fprintf(out, "\"tag\":\"%" PRIu64 "\"%s", status->lastTag, (flags & ~TypeWasTagged) ? "," : "") < 0) return CborErrorIO; } @@ -300,11 +299,10 @@ static CborError add_value_metadata(FILE *out, CborType type, const ConversionSt if (fprintf(out, ",\"v\":\"nan\"") < 0) return CborErrorIO; if (flags & NumberWasInfinite) - if (fprintf(out, ",\"v\":\"%sinf\"", flags & NumberWasNegative ? "-" : "") < 0) + if (fprintf(out, ",\"v\":\"%sinf\"", (flags & NumberWasNegative) ? "-" : "") < 0) return CborErrorIO; if (flags & NumberPrecisionWasLost) - if (fprintf(out, ",\"v\":\"%c%" PRIx64 "\"", flags & NumberWasNegative ? '-' : '+', - status->originalNumber) < 0) + if (fprintf(out, ",\"v\":\"%c%" PRIx64 "\"", (flags & NumberWasNegative) ? '-' : '+', status->originalNumber) < 0) return CborErrorIO; if (type == CborSimpleType) if (fprintf(out, ",\"v\":%d", (int)status->originalNumber) < 0)