cmd screen
This commit is contained in:
@@ -133,6 +133,20 @@ bool_t stringToU16(const char_t *str, uint16_t *out) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool_t stringToF32(const char_t *str, float_t *out) {
|
||||
assertNotNull(str, "str must not be NULL");
|
||||
assertNotNull(out, "out must not be NULL");
|
||||
|
||||
char_t *endptr;
|
||||
errno = 0;
|
||||
float_t result = strtof(str, &endptr);
|
||||
if (errno != 0 || *endptr != '\0') {
|
||||
return false;
|
||||
}
|
||||
*out = 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");
|
||||
|
||||
Reference in New Issue
Block a user