]> granicus.if.org Git - graphviz/commitdiff
remove unused addSpace parameter to gv_trim_zeros()
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 29 Oct 2020 01:08:42 +0000 (18:08 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 4 Nov 2020 15:37:28 +0000 (07:37 -0800)
lib/gvc/gvdevice.c

index ccf8e46f4926c494b2e56014f528f01701ea4cd9..83a0e7d950d70ed7124cf99c1021018f9e233e79 100644 (file)
@@ -535,9 +535,8 @@ int main (int argc, char *argv[])
 
 /* gv_trim_zeros
 * Trailing zeros are removed and decimal point, if possible.
-* Add trailing space if addSpace is non-zero.
 */
-static void gv_trim_zeros(char* buf, int addSpace)
+static void gv_trim_zeros(char* buf)
 {
     char* dotp;
     char* p;
@@ -552,13 +551,6 @@ static void gv_trim_zeros(char* buf, int addSpace)
         else
             p++;
     }
-    else if (addSpace)
-        p = buf + strlen(buf);
-
-    if (addSpace) { /* p points to null byte */
-        *p++ = ' ';
-        *p = '\0';
-    }
 }
 
 void gvprintdouble(GVJ_t * job, double num)
@@ -573,7 +565,7 @@ void gvprintdouble(GVJ_t * job, double num)
     char buf[50];
 
     snprintf(buf, 50, "%.02f", num);
-    gv_trim_zeros(buf, 0);
+    gv_trim_zeros(buf);
 
     gvwrite(job, buf, strlen(buf));
 }