Browse Source

Fix faux_str_charsn()

Serj Kalichev 1 year ago
parent
commit
d8efd996f9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      faux/str/str.c

+ 1 - 1
faux/str/str.c

@@ -673,7 +673,7 @@ char *faux_str_charsn(const char *str, const char *chars_to_search, size_t n)
 	if (!str || !chars_to_search)
 		return NULL;
 
-	while ((*current_char != '\0') && (len > 0)) {
+	while ((len > 0) && (*current_char != '\0')) {
 		if (strchr(chars_to_search, *current_char))
 			return (char *)current_char;
 		current_char++;