Merge pull request #199 from mwierzbix/rstrcmp_nullTerminatorCheck

lib: rstrcmp: null terminator check
This commit is contained in:
Liam Girdwood 2018-08-07 09:39:40 -07:00 committed by GitHub
commit 7e5823d8b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -119,6 +119,12 @@ int rstrcmp(const char *s1, const char *s2)
s2++;
}
/* did both string end */
if (*s1 != 0)
return 1;
if (*s2 != 0)
return -1;
/* match */
return 0;
}