getenv_f(): fix handling of too short buffers
authorWolfgang Denk <wd@denx.de>
Sat, 24 Jul 2010 20:16:20 +0000 (22:16 +0200)
committerWolfgang Denk <wd@denx.de>
Sun, 8 Aug 2010 22:53:57 +0000 (00:53 +0200)
commit9ed4a9582ff61225d46241a1c99795549722503c
tree26d69509babcff8af8f7316fbb8cbe4c04e84606
parent739b8080af30d6de73b13725abe27275dd3b27f6
getenv_f(): fix handling of too short buffers

Fix error handling in getenv_f() when the user provided buffer is too
short to hold the variable name; make sure to truncate and
NUL-terminate without overwriting the buffer limits.

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