[PATCH 2/2] time command: Fix needed string length

Sascha Hauer s.hauer at pengutronix.de
Thu Dec 8 04:45:27 EST 2011


Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 commands/time.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/commands/time.c b/commands/time.c
index 9a76945..c2633ba 100644
--- a/commands/time.c
+++ b/commands/time.c
@@ -10,7 +10,7 @@ static int do_time(struct command *cmdtp, int argc, char *argv[])
 	unsigned char *buf;
 	u64 start, end, diff64;
 	unsigned long diff;
-	int len = 0;
+	int len = 1; /* '\0' */
 
 	if (argc < 2)
 		return COMMAND_ERROR_USAGE;
-- 
1.7.7.3




More information about the barebox mailing list