mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 00:32:04 +02:00
lib: Add a function to convert a string to upper case
Add a helper function for this operation. Update the strtoul() tests to check upper case as well. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
@@ -179,3 +179,11 @@ long trailing_strtol(const char *str)
|
||||
{
|
||||
return trailing_strtoln(str, NULL);
|
||||
}
|
||||
|
||||
void str_to_upper(const char *in, char *out, size_t len)
|
||||
{
|
||||
for (; len > 0 && *in; len--)
|
||||
*out++ = toupper(*in++);
|
||||
if (len)
|
||||
*out = '\0';
|
||||
}
|
||||
|
Reference in New Issue
Block a user