From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YpwQ1-0001zo-U3 for ltp-list@lists.sourceforge.net; Wed, 06 May 2015 10:19:09 +0000 Received: from [59.151.112.132] (helo=heian.cn.fujitsu.com) by sog-mx-2.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1YpwQ0-0004vv-S7 for ltp-list@lists.sourceforge.net; Wed, 06 May 2015 10:19:09 +0000 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id t46AHiDV016835 for ; Wed, 6 May 2015 18:17:44 +0800 From: "Wei,Jiangang" Date: Wed, 6 May 2015 18:18:20 +0800 Message-ID: <1430907502-30493-1-git-send-email-weijg.fnst@cn.fujitsu.com> MIME-Version: 1.0 Subject: [LTP] [PATCH 1/3] kernel/syscalls/fallocate: fix array parameter degradation List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: ltp-list@lists.sourceforge.net Using 'sizeof' on array given as function argument returns size of a pointer, instead of the array's. So, It needs to pass an additional parameter size_t size indicating the number of elements in the array. This patch can fix it. Signed-off-by: Wei,Jiangang --- testcases/kernel/syscalls/fallocate/fallocate04.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testcases/kernel/syscalls/fallocate/fallocate04.c b/testcases/kernel/syscalls/fallocate/fallocate04.c index 723c886..a6d1159 100644 --- a/testcases/kernel/syscalls/fallocate/fallocate04.c +++ b/testcases/kernel/syscalls/fallocate/fallocate04.c @@ -98,9 +98,8 @@ static void setup(void) get_blocksize(); } -static void check_file_data(const char exp_buf[]) +static void check_file_data(const char exp_buf[], size_t size) { - size_t size = sizeof(exp_buf); char rbuf[size]; tst_resm(TINFO, "reading the file, compare with expected buffer"); -- 1.9.3 ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list