Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
misc dbl: coverity fixes
  • Loading branch information
perexg committed Oct 3, 2014
1 parent e6badc8 commit 7808495
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/misc/dbl.c
Expand Up @@ -183,7 +183,9 @@ my_double2str(char *buf, size_t bufsize, double realvalue)
if( xtype==xGENERIC && precision>0 ) precision--;
for(idx=precision, rounder=0.5; idx>0; idx--, rounder*=0.1){}

#if 0 /* coverity - dead code 'xtype == xGENERIC' here */
if( xtype==xFLOAT ) realvalue += rounder;
#endif
/* Normalize realvalue to within 10.0 > realvalue >= 1.0 */
exp = 0;

Expand Down Expand Up @@ -268,9 +270,12 @@ my_double2str(char *buf, size_t bufsize, double realvalue)
while( bufpt[-1]=='0' ) *(--bufpt) = 0;
assert( bufpt>buf );
if( bufpt[-1]=='.' ){
#if 0 /* coverity - dead code - flag_altform2 == 0 here */
if( flag_altform2 ){
*(bufpt++) = '0';
}else{
}else
#endif
{
*(--bufpt) = 0;
}
}
Expand Down

0 comments on commit 7808495

Please sign in to comment.