diff --git a/src/common/slurm_errno.c b/src/common/slurm_errno.c index 99826e1bbea00aeba6cf07663c221e727abd948e..9238d048f3325e4421656e04a0a592bf4604643c 100644 --- a/src/common/slurm_errno.c +++ b/src/common/slurm_errno.c @@ -492,7 +492,12 @@ static char *_lookup_slurm_api_errtab(int errnum) char *slurm_strerror(int errnum) { char *res = _lookup_slurm_api_errtab(errnum); - return (res ? res : strerror(errnum)); + if (res) + return res; + else if (errnum > 0) + return strerror(errnum); + else + return "Unknown negative error number"; } /*