projects
/
infodrom
/
dtaus
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
177b7c1
)
Added legacy code to avoid GCC warnings
author
Joey Schulze
<joey@infodrom.org>
Wed, 4 Aug 2004 20:06:03 +0000
(20:06 +0000)
committer
Joey Schulze
<joey@infodrom.org>
Wed, 4 Aug 2004 20:06:03 +0000
(20:06 +0000)
dtaus.c
patch
|
blob
|
history
diff --git
a/dtaus.c
b/dtaus.c
index
e533b67
..
bfb2dfb
100644
(file)
--- a/
dtaus.c
+++ b/
dtaus.c
@@
-273,6
+273,7
@@
char *real2string(char *s)
{
static char res[20];
char *cp;
+ char *xp; /* only to avoid a GCC warning */
strncpy(res, s, sizeof(res)-1);
res[sizeof(res)-1] = 0;
@@
-287,13
+288,15
@@
char *real2string(char *s)
if (*cp == '.' || *cp == ',') {
if (*(cp+1)) {
/* 1st decimal place */
- if (isdigit(*(cp+1)))
- *(cp++) = *(cp+1);
+ xp = cp+1;
+ if (*xp && isdigit(*xp))
+ *(cp++) = *xp;
else
*(cp++) = '0';
/* 2nd decimal place */
- if (*(cp+1) && isdigit(*(cp+1)))
- *(cp++) = *(cp+1);
+ xp = cp+1;
+ if (*xp && isdigit(*xp))
+ *(cp++) = *xp;
else
*(cp++) = '0';
} else {