1
0
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:
Simon Glass
2020-04-08 08:32:56 -06:00
committed by Tom Rini
parent 4f04d54981
commit fdc79a6b12
3 changed files with 84 additions and 16 deletions

View File

@@ -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';
}