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.
/* 1234e7 -> 12340000000 */
if (kk - length > 0) {
- memset(&start[length], (int) '0', kk - length);
+ memset(&start[length], '0', kk - length);
}
return kk;
start[1] = '.';
if (offset - 2 > 0) {
- memset(&start[2], (int) '0', offset - 2);
+ memset(&start[2], '0', offset - 2);
}
return (length + offset);