X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp-builds.git;a=blobdiff_plain;f=src%2Foutput%2Ftable.c;h=04181e44f709b9ca1d2fcb9cab3abcce207b9595;hp=7460fce373186151a1d5e3aaff380426674593b7;hb=89306c3c6b335e23a09bc2c3442d8b08e60cb328;hpb=1dde249bcf2bbdb0ecc5bc972a62c45f2a1623df diff --git a/src/output/table.c b/src/output/table.c index 7460fce3..04181e44 100644 --- a/src/output/table.c +++ b/src/output/table.c @@ -599,9 +599,7 @@ void tab_double (struct tab_table *table, int c, int r, unsigned char opt, double val, const struct fmt_spec *fmt) { - int w; - char *s, *cp; - + struct substring ss; union value double_value ; assert (table != NULL); @@ -631,16 +629,11 @@ tab_double (struct tab_table *table, int c, int r, unsigned char opt, #endif double_value.f = val; - s = data_out_pool (&double_value, LEGACY_NATIVE, fmt, table->container); + ss = ss_cstr (data_out_pool (&double_value, LEGACY_NATIVE, fmt, table->container)); - cp = s; - while (isspace ((unsigned char) *cp) && cp < s + fmt->w) - { - cp++; - } - w = fmt->w - (cp - s); - - table->cc[c + r * table->cf] = ss_buffer (cp, w); + ss_ltrim (&ss, ss_cstr (" ")); + + table->cc[c + r * table->cf] = ss; table->ct[c + r * table->cf] = opt; }