From: Ben Pfaff Date: Tue, 25 Apr 2006 20:17:13 +0000 (+0000) Subject: Simplify a bit of code using snprintf(). X-Git-Tag: v0.6.0~950 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0be7aa66ca53bae5945ca5d31b517749a042bb7;p=pspp-builds.git Simplify a bit of code using snprintf(). --- diff --git a/src/language/stats/ChangeLog b/src/language/stats/ChangeLog index 8d6066ff..be1dbf76 100644 --- a/src/language/stats/ChangeLog +++ b/src/language/stats/ChangeLog @@ -1,3 +1,8 @@ +Tue Apr 25 13:16:28 2006 Ben Pfaff + + * flip.c (flip_sink_write): Use snprintf() to simplify a bit of + code. + 2006-04-21 Jason Stover * regression.q (try_name): New function. (Partly copied from diff --git a/src/language/stats/flip.c b/src/language/stats/flip.c index f2c0290c..95a5f6d1 100644 --- a/src/language/stats/flip.c +++ b/src/language/stats/flip.c @@ -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 {