commit asset prog
This commit is contained in:
@@ -125,4 +125,14 @@ bool_t stringToU16(const char_t *str, uint16_t *out) {
|
||||
}
|
||||
*out = (uint16_t)result;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool_t stringEndsWith(const char_t *str, const char_t *suffix) {
|
||||
assertNotNull(str, "str must not be NULL");
|
||||
assertNotNull(suffix, "suffix must not be NULL");
|
||||
|
||||
size_t strLen = strlen(str);
|
||||
size_t suffixLen = strlen(suffix);
|
||||
if(suffixLen > strLen) return false;
|
||||
return strcmp(str + strLen - suffixLen, suffix) == 0;
|
||||
}
|
Reference in New Issue
Block a user