When the return type of the function is int, it's better to return an
authorRichard Levitte <levitte@openssl.org>
Thu, 9 Jun 2005 17:28:53 +0000 (17:28 +0000)
committerRichard Levitte <levitte@openssl.org>
Thu, 9 Jun 2005 17:28:53 +0000 (17:28 +0000)
in than NULL, especially when an error is signalled with a negative
value.

crypto/dso/dso_lib.c

index 0869a64..12ad097 100644 (file)
@@ -472,7 +472,7 @@ int DSO_pathbyaddr(void *addr,char *path,int sz)
        if (meth->pathbyaddr == NULL)
                {
                DSOerr(DSO_F_PATHBYADDR,DSO_R_UNSUPPORTED);
-               return(NULL);
+               return -1;
                }
        return (*meth->pathbyaddr)(addr,path,sz);
        }