projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve code to trim leading spaces from numeric output.
[pspp-builds.git]
/
src
/
output
/
table.c
diff --git
a/src/output/table.c
b/src/output/table.c
index 7460fce373186151a1d5e3aaff380426674593b7..04181e44f709b9ca1d2fcb9cab3abcce207b9595 100644
(file)
--- 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)
{
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);
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;
#endif
double_value.f = val;
- s
= data_out_pool (&double_value, LEGACY_NATIVE, fmt, table->container
);
+ s
s = 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;
}
table->ct[c + r * table->cf] = opt;
}