18 Sep 15:34
Pointer arithmetic in src/direnum.c:561
From: Jon <fsvs <at> jonmail.co.uk>
Subject: Pointer arithmetic in src/direnum.c:561
Newsgroups: gmane.comp.sysutils.backup.fsvs.devel
Date: 2008-09-18 13:36:41 GMT
Subject: Pointer arithmetic in src/direnum.c:561
Newsgroups: gmane.comp.sysutils.backup.fsvs.devel
Date: 2008-09-18 13:36:41 GMT
Hi, I think line src/direnum.c:561 should change from: sts->name=names[i] + this->strings; to: sts->name=this->strings + names[i]; I have spent the last 3 evenings trying to get fsvs running on my Nokia N800 and kept getting segmentation faults every time I ran the command: fsvs commit -m 'yada-yada-yada' /etc Using DEBUGP and binary chopping through the code I tracked the segfault down to src/direnum.c:587 which uses sts->name. The last change to sts->name was made at 561 which does the fancy pointer arithmetic to convert an integer offset from the names[] array to a char*. I use a cross-compiler to build programs for the Nokia N800. I suspect that the compiler will only generate the code I want when the source expression looks like char*+int. I think it generates bad code when the source expression is int+char*. Thanks Jonty
RSS Feed