]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
cmd_nvedit.c: make error message more helpful
authorWolfgang Denk <wd@denx.de>
Wed, 4 May 2011 10:29:49 +0000 (10:29 +0000)
committerWolfgang Denk <wd@denx.de>
Thu, 12 May 2011 17:47:14 +0000 (19:47 +0200)
When calling getenv_f() with a too small buffer, it would print an
error message like this:

env_buf too small [32]

This is not really helpful as it does not give any indication which of
the calls might have failed.  Change this into:

env_buf [32 bytes] too small for value of "hwconfig"

so we know at least which variable caused the overflow; this usually
allows to quickly find the related code as well.

Signed-off-by: Wolfgang Denk <wd@denx.de>
common/cmd_nvedit.c

index aa9de3a4ea31a8f141d066c6bbafd19a60fb2a4c..b2c88babc41a11c1be8353a09370e383f5db623a 100644 (file)
@@ -532,7 +532,8 @@ int getenv_f(char *name, char *buf, unsigned len)
                if (n)
                        *--buf = '\0';
 
-               printf("env_buf too small [%d]\n", len);
+               printf("env_buf [%d bytes] too small for value of \"%s\"\n",
+                       len, name);
 
                return n;
        }