Added legacy code to avoid GCC warnings
[infodrom/dtaus] / dtaus.c
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 {