string-util: fix typo

Follow-up for 63566c6b6f.
This commit is contained in:
Yu Watanabe
2024-01-05 19:08:12 +09:00
parent 56a89426f6
commit 9e44842a9a
+2 -2
View File
@@ -1512,14 +1512,14 @@ char *strrstr(const char *haystack, const char *needle) {
const char *f = NULL;
size_t l;
/* Like strstr() but returns the last rather than the first occurence of "needle" in "haystack". */
/* Like strstr() but returns the last rather than the first occurrence of "needle" in "haystack". */
if (!haystack || !needle)
return NULL;
l = strlen(needle);
/* Special case: for the empty string we return the very last possible occurence, i.e. *after* the
/* Special case: for the empty string we return the very last possible occurrence, i.e. *after* the
* last char, not before. */
if (l == 0)
return strchr(haystack, 0);