Skip to content

Commit 7e5823d

Browse files
authored
Merge pull request #199 from mwierzbix/rstrcmp_nullTerminatorCheck
lib: rstrcmp: null terminator check
2 parents 876115c + 61dc29b commit 7e5823d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/lib/lib.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ int rstrcmp(const char *s1, const char *s2)
119119
s2++;
120120
}
121121

122+
/* did both string end */
123+
if (*s1 != 0)
124+
return 1;
125+
if (*s2 != 0)
126+
return -1;
127+
122128
/* match */
123129
return 0;
124130
}

0 commit comments

Comments
 (0)