-
Notifications
You must be signed in to change notification settings - Fork 119
find() and find_last() functions return ambiguous value #58
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
If a NULL or empty string is passed into rcutils_find() or rcutils_find_last(), they return 0. However, it may also be the case that the delimiter being searched for is in the zero'th position, and the caller doesn't have any way to disambiguate this. As discussed in #57 (review), we should probably change this so that rcutils and rcutils_find_last return something different; either a negative value (which would require us to change the return type), or the size of the string (indicating it wasn't found). The latter will obviously only work on empty strings, not NULL arguments. In either case, we need to audit all of the callers and make sure they do the correct thing.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working