In the previous edit the exit(3) statement was replaced with a return, to comply with R CRAN requirements that the calls to C subroutines should never be able to cause R termination with exit.
Here I'm replacing return 0 with return 3 to have a return value equal to the previous exit code, although this does not seem to be handled by upstream C++ code calling this subroutine
In the previous edit the exit(3) statement was replaced with a return, to comply with R CRAN requirements that the calls to C subroutines should never be able to cause R termination with exit.
Here I'm replacing return 0 with return 3 to have a return value equal to the previous exit code, although this does not seem to be handled by upstream C++ code calling this subroutine