Say I have:

Code:
int sl_find(StringList *pSl, const char *str)
{
    if(NULL == pSl || NULL == str)
    {
        return FAIL;
    }
    size_t i;
    for(i = 0; i < pSl->size; i++)
    {
        if(strcmp(pSl->data[i], str) == 0) return i;
    }
    return -2;
}
Where #define FAIL -1

Its purpose is to locate a substring in the stringlist. If we find, we return the position. If we don't find, we return -1. What would you return in an error case such as NULL input ptrs? I don't want to return -1 becausae that would be ambiguous with "not found" but -2 is also not super conventional. I know an alternative is to use an output param but that feels heavy and a bit untuitive to either store the index or an error code.
Just high level, how do you reason about these types of things?
Not necessarily specific to this exact code. I've looked at for example the standard string.h functions and the return codes don't seem to be entirely consistent throughout.