Skip to content

Commit

Permalink
Update strncmp.c
Browse files Browse the repository at this point in the history
  • Loading branch information
ohkimur authored Apr 1, 2024
1 parent 40937ff commit 60fe24d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chapter_5/exercise_5_05/strncmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int strcmp_ptr(char *s, char *t, size_t n)

// If the t string contains more character than s, then the s char will
// become '\0' before t char. If this happen then the s char will be 0 and
// t char will be whatever ascii_value it's holding, so the final result will be 0 - t_ascii_value.
// t char will be whatever ascii_value is holding, so the final result will be 0 - t_ascii_value.

return *s - *t;
}

0 comments on commit 60fe24d

Please sign in to comment.