From 14a840b911701783687321fbc74ab43e1dc844b2 Mon Sep 17 00:00:00 2001 From: wuyangyong Date: Sat, 4 Dec 2010 07:27:11 +0000 Subject: [PATCH] fix cat print buffer no \0 git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1176 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- components/dfs/src/dfs_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/dfs/src/dfs_file.c b/components/dfs/src/dfs_file.c index 15b42a2af9..4deba547be 100644 --- a/components/dfs/src/dfs_file.c +++ b/components/dfs/src/dfs_file.c @@ -516,7 +516,7 @@ void cat(const char* filename) do { rt_memset(buffer, 0, sizeof(buffer)); - length = dfs_file_read(&fd, buffer, 81); + length = dfs_file_read(&fd, buffer, sizeof(buffer)-1 ); if (length > 0) { rt_kprintf("%s", buffer);