diff --git a/chapter_5/exercise_5_04/strend.c b/chapter_5/exercise_5_04/strend.c index 53673be..9094d86 100644 --- a/chapter_5/exercise_5_04/strend.c +++ b/chapter_5/exercise_5_04/strend.c @@ -32,8 +32,8 @@ int strend(char *s, char *t) size_t t_length = strlen(t); // Move the s & t pointer to the end of the corresponding strings. - s += s_length; - t += t_length; + s += s_length - 1; + t += t_length - 1; // Check backwards if each character from string t occurs in the corresonding // location from the string s.