On Tue, 17 Oct 2017, A. Coady (JIRA) wrote:

Indeed. These return NULL on error, not < 0.
Thank you for the bug report. This is fixed in rev 1812455.

Andi..