Subject: | Perl corrupted when run 50chopblanks.t on ActivePerl5.8.2 win32 |
On ActivePerl 5.8.2 for win32 and Visual C++ 6.0SP5:
perl makefile.pl
nmake test
Perl is corrupted when run 50chopblanks.t
I have tried to debug it and found that dbdmp.c has bugs. I have corrected it and it works now.
AV *
sqlite_st_fetch (SV *sth, imp_sth_t *imp_sth)
{
...
if (chopBlanks) {
val = savepv(val);
while((len > 0) && (val[len-1] == ' ')) {
len--;
}
val[len] = '\0';
}
decoded = sqlite_decode(imp_dbh, val, &len);
sv_setpvn(AvARRAY(av)[i], decoded, len);
free(decoded);
if (chopBlanks) Safefree(val);
...
}
Line 482, it should be "savepv" instead of "stdup"
Line 491, it should be "Safefree" instead of "free"