Fix bogus invocation of _pyReturnError() in __dmidecode_xml_getsection()
Fixes the following error:
src/dmidecodemodule.c: In function ‘__dmidecode_xml_getsection’: src/dmidecodemodule.c:482:90: error: passing argument 3 of ‘_pyReturnError’ makes integer from pointer without a cast [-Wint-conversion] 482 | _pyReturnError(PyExc_RuntimeError, "Invalid type id '%s' -- %s", typeid, err); | ^~~~~~ | | |
I think they meant to call PyReturnError here. https://github.com/nima/python-dmidecode/blob/master/src/dmierror.h#L48 The signature matches with what's being passed as arguments.
I think they meant to call PyReturnError here. https://github.com/nima/python-dmidecode/blob/master/src/dmierror.h#L48 The signature matches with what's being passed as arguments.
Nope, PyReturnError() is a macro that contains a return instruction and would end the execution __dmidecode_xml_getsection() prematurely so that the following call to free() would be missed.
Right. Well, at least I guess
NULL, 0 should become __FILE__, __LINE__
Right. Well, at least I guess NULL, 0 should become FILE, LINE
Those are place holders in the macro and not local variables to the function __dmidecode_xml_getsection.
Those are standard macros that evaluate to file name and line.
hisshadow@uberlaptop ~ $ cat 2.c
__FILE__
__LINE__
hisshadow@uberlaptop ~ $ gcc -E 2.c
# 0 "2.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "2.c"
"2.c"
2