commit bd1d8e2dde1522f245e99a569cbbbf68a7ee1800
parent bac50e3cb44c05c4921eefc5bdca9fa2636ff6d0
Author: Claudio Alessi <smoppy@gmail.com>
Date: Sun, 28 Feb 2016 14:53:32 +0100
Let a bug happen less frequent.
A comment has been added, it have to be fixed... obviously.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/core.c b/core.c
@@ -334,9 +334,10 @@ records(void) {
for(item = selview->items; item; item = item->next) {
strncpy(txt, "listitem text:\"", sizeof txt);
for(int i = 0; i < item->nfields; ++i) {
- snprintf(t, sizeof t, "%18.16s", item->fields[i]);
+ snprintf(t, sizeof t, "%8.16s", item->fields[i]);
if(i)
strncat(txt, " | ", sizeof txt);
+ /* XXX What if strlen(all_fields) > sizeof txt? */
strncat(txt, t, sizeof txt);
}
strncat(txt, "\"", sizeof txt);