Closed Vascom closed 3 years ago
There are many functions of type void in the API - turning them to int or bool just to return the error would break compatibility with existing apps completely, which would be even worse.
The only circumstance which triggers the exit is when calloc() or realloc() fails - this happens hardly ever, if at all, and if it happens, then you are probably out of memory, so there is no point in expecting reliable operation of this or any other app.
OK, but I had to do this bug report.
libacar call exit when compiled as shared lib. This is bad.
This library package calls exit() or _exit(), probably in a non-fork() context. Doing so from a library is strongly discouraged - when a library function calls exit(), it prevents the calling program from handling the error, reporting it to the user, closing files properly, and cleaning up any state that the program has. It is preferred for the library to return an actual error code and let the calling program decide how to handle the situation.
Please correct it.