From 32203e5e8aa7e4089d101fb3dddbf54698abb86b Mon Sep 17 00:00:00 2001 From: Joey Schulze Date: Wed, 4 Aug 2004 20:06:03 +0000 Subject: [PATCH] Added legacy code to avoid GCC warnings --- dtaus.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dtaus.c b/dtaus.c index e533b67..bfb2dfb 100644 --- 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 { -- 2.20.1