From 6dc1e2f10c7ca8ba7caf5444efeb5bb015837829 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Beh=C3=BAn?= Date: Sun, 17 Oct 2021 17:36:26 +0200 Subject: [PATCH] env: Fix documentation for env_get_f() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This function actually returns: - the number of bytes written into @buf excluding the terminating NULL-byte, if there was enough space in @buf - the number of bytes written into @buf including the terminating NULL-byte, if there wasn't enough space in @buf - -1 if the variable is not found Signed-off-by: Marek Behún Reviewed-by: Simon Glass --- include/env.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/env.h b/include/env.h index d5e2bcb530..b1a4003681 100644 --- a/include/env.h +++ b/include/env.h @@ -131,7 +131,10 @@ char *from_env(const char *envvar); * support reading the value (slowly) and some will not. * * @varname: Variable to look up - * @return value of variable, or NULL if not found + * @return number of bytes written into @buf, excluding the terminating + * NULL-byte if there was enough space in @buf, and including the + * terminating NULL-byte if there wasn't enough space, or -1 if the + * variable is not found */ int env_get_f(const char *name, char *buf, unsigned int len); -- 2.39.5