Skip to content

Commit

Permalink
fix: strrstr bug
Browse files Browse the repository at this point in the history
Signed-off-by: Dengfeng Liu <[email protected]>
  • Loading branch information
liudf0716 committed Jun 12, 2024
1 parent ed8a3eb commit d5d138a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dns_forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ strrstr(const char *haystack, const char *needle)
return NULL;
}

for (size_t i = haystack_len - needle_len; i >= 0; i--) {
for (size_t i = haystack_len - needle_len; i > 0; i--) {
if (strncmp(haystack + i, needle, needle_len) == 0) {
result = (char *)(haystack + i);
break;
Expand Down

0 comments on commit d5d138a

Please sign in to comment.