From: Dmitry Volyntsev Date: Mon, 23 Jul 2018 13:35:32 +0000 (+0300) Subject: Backed out changeset 552da720e6e6. X-Git-Tag: 0.2.3~10 X-Git-Url: http://git.kaiwu.me/sitemap.xml?a=commitdiff_plain;h=e8393be2b33286e02ca736e7307d3df43cfd48bb;p=njs.git Backed out changeset 552da720e6e6. The original code was correct, the (int) casting does not change anything because the type of the '0' literal is int. The solution to the original problem is to mark CID 1438046 as false-positive. --- diff --git a/nxt/nxt_dtoa.c b/nxt/nxt_dtoa.c index bb3d65a0..6453f87f 100644 --- a/nxt/nxt_dtoa.c +++ b/nxt/nxt_dtoa.c @@ -280,7 +280,7 @@ nxt_prettify(char *start, size_t len, int dec_exp) /* 1234e7 -> 12340000000 */ if (kk - length > 0) { - memset(&start[length], (int) '0', kk - length); + memset(&start[length], '0', kk - length); } return kk; @@ -305,7 +305,7 @@ nxt_prettify(char *start, size_t len, int dec_exp) start[1] = '.'; if (offset - 2 > 0) { - memset(&start[2], (int) '0', offset - 2); + memset(&start[2], '0', offset - 2); } return (length + offset);