I got a weird zziplib crash and I don't really understand what is going wrong %)
It's in zzip.c, line 385 (I debugged with 'gcc -g' and psplink). A pointer representing a zip file entry is dereferenced, and the PSP crashes ("Program received signal SIGHUP, Hangup.").
I tried to decompose the code, and then rewrote it using bit shifts - and then it worked.
Do you know what went wrong here?
My random guess is that d->z_offset isn't always four bytes aligned? Which is a real issue on most RISC machines ;)
The original is doing a 32bit load which needs the pointer to be aligned to 4bytes, and your "doesn't crash" code is doing 8bit loads which don't care.
This could well be the reason, the field is at offset 42 in the structure.
It didn't crash when I did it manually from GDB though!
I'm surprised it works for other devs. Admittedly my .zip is special as it's appened to EBOOT.PBP (with zip -A), in an attempt to create bundled resources, so it has a non-zero offset :) However the code that parses d->z_offset is always executed AFAICS.
I'm going to submit a patch for this; do you think my solution is fine, or is there a better way?