summaryrefslogtreecommitdiff
path: root/include/vsprintf.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-10-14 21:48:06 +0300
committerTom Rini <trini@konsulko.com>2021-11-12 03:02:32 +0300
commit3bfb0f719a196558f909ca568f3803f86a190509 (patch)
tree27b04d170f53130ec20a7d5087f0e075ac52b8e3 /include/vsprintf.h
parent74b7a2b8815cf953ea0b72800bd9db7f0d6a119a (diff)
downloadu-boot-3bfb0f719a196558f909ca568f3803f86a190509.tar.xz
lib: Add tests for simple_itoa()
Add test and a comment for this function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Diffstat (limited to 'include/vsprintf.h')
-rw-r--r--include/vsprintf.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/vsprintf.h b/include/vsprintf.h
index 83d187e53d..4479df0af3 100644
--- a/include/vsprintf.h
+++ b/include/vsprintf.h
@@ -172,7 +172,18 @@ int sprintf(char *buf, const char *fmt, ...)
* See the vsprintf() documentation for format string extensions over C99.
*/
int vsprintf(char *buf, const char *fmt, va_list args);
-char *simple_itoa(ulong i);
+
+/**
+ * simple_itoa() - convert an unsigned integer to a string
+ *
+ * This returns a static string containing the decimal representation of the
+ * given value. The returned value may be overwritten by other calls to the
+ * same function, so should be used immediately
+ *
+ * @val: Value to convert
+ * @return string containing the decimal representation of @val
+ */
+char *simple_itoa(ulong val);
/**
* Format a string and place it in a buffer