Gabriel Ivăncescu gabrielopcode@gmail.com writes:
The problem seems to be in the fact that the 'used' parameter is *never* set in this case. It passes 'used ? &used_tmp : NULL' and then breaks out of the switch -- and the 'if (used) *used = used_tmp;' statement only applies in the default case of the switch. So I'm basically using an uninitialized variable.
Is this intended, or a bug?
It's a bug, thanks for catching it.