Simplify a bit of code using snprintf().
authorBen Pfaff <blp@gnu.org>
Tue, 25 Apr 2006 20:17:13 +0000 (20:17 +0000)
committerBen Pfaff <blp@gnu.org>
Tue, 25 Apr 2006 20:17:13 +0000 (20:17 +0000)
src/language/stats/ChangeLog
src/language/stats/flip.c

index 8d6066ffd6a1d0f9c013f45be3ba8cc2c314f9bc..be1dbf76af5ef87e48bbef0a919204dc67cb6594 100644 (file)
@@ -1,3 +1,8 @@
+Tue Apr 25 13:16:28 2006  Ben Pfaff  <blp@gnu.org>
+
+       * flip.c (flip_sink_write): Use snprintf() to simplify a bit of
+       code.
+
 2006-04-21  Jason Stover  <jhs@math.gcsu.edu>
 
        * regression.q (try_name): New function. (Partly copied from
index f2c0290c0b31cf3823e2438cfd4793ae34645261..95a5f6d1594d8e8a2fa7e530c076da3653dee99e 100644 (file)
@@ -331,12 +331,8 @@ flip_sink_write (struct case_sink *sink, const struct ccase *c)
             strcpy (v->name, "VNEGINF");
           else if (f > INT_MAX)
             strcpy (v->name, "VPOSINF");
-          else 
-            {
-              char name[INT_STRLEN_BOUND (int) + 2];
-              sprintf (name, "V%d", (int) f);
-              str_copy_trunc (v->name, sizeof v->name, name);
-            }
+          else
+            snprintf (v->name, sizeof v->name, "V%d", (int) f);
         }
       else
        {