1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-02 01:02:19 +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

@@ -222,4 +222,16 @@ bool str2long(const char *p, ulong *num);
* @hz: Value to convert
*/
char *strmhz(char *buf, unsigned long hz);
/**
* str_to_upper() - Convert a string to upper case
*
* This simply uses toupper() on each character of the string.
*
* @in: String to convert (must be large enough to hold the output string)
* @out: Buffer to put converted string
* @len: Number of bytes available in @out (SIZE_MAX for all)
*/
void str_to_upper(const char *in, char *out, size_t len);
#endif