// force the loop to stop and an error to be returned
n = -1;
- srcLen = 0;
+ srcLen = 1;
break;
case PAD:
{
// force the loop terminate with an error
n = -1;
- srcLen = 0;
+ srcLen = 1;
}
break;
{
// nothing is allowed after the end so provoke error return
n = -1;
- srcLen = 0;
+ srcLen = 1;
break;
}
if ( n )
{
if ( posErr )
- *posErr = p - src;
+ {
+ // notice that the error was on a previous position as we did one
+ // extra "p++" in the loop line after it
+ *posErr = p - src - 1;
+ }
return wxCONV_FAILED;
}