]> git.kaiwu.me - njs.git/commitdiff
Backed out changeset 552da720e6e6.
authorDmitry Volyntsev <xeioex@nginx.com>
Mon, 23 Jul 2018 13:35:32 +0000 (16:35 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Mon, 23 Jul 2018 13:35:32 +0000 (16:35 +0300)
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.

nxt/nxt_dtoa.c

index bb3d65a0427490cad475ea7e91d53f0084461463..6453f87f495086d51565eecf16674d0fd0fd8db4 100644 (file)
@@ -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);