Commit 40937ff
authored
Update strncmp.c
Increased the accuracy of the comment description, and removed the " != '\0' " part of the while test. Comparing two characters for equality doesn't require seeing if their comparison is not equal to null, it is the same as writing "while ((x == y) != 0)". If x and y are ints or any other datetype, the '==' check suffices when checking for a boolean value.1 parent 7f3097e commit 40937ff
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
| 42 | + | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
| 46 | + | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
0 commit comments