From patchwork Sat Jul 7 23:23:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rodrigo Siqueira X-Patchwork-Id: 10512973 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C89AC600CA for ; Sat, 7 Jul 2018 23:23:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8522288E1 for ; Sat, 7 Jul 2018 23:23:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC8AA288EA; Sat, 7 Jul 2018 23:23:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6C342288E1 for ; Sat, 7 Jul 2018 23:23:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D5BC46E354; Sat, 7 Jul 2018 23:23:22 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qt0-x241.google.com (mail-qt0-x241.google.com [IPv6:2607:f8b0:400d:c0d::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id A131C6E352; Sat, 7 Jul 2018 23:23:21 +0000 (UTC) Received: by mail-qt0-x241.google.com with SMTP id f1-v6so12808546qti.3; Sat, 07 Jul 2018 16:23:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Zb1NvncXv7T3k4Sy8sIq7MB2YNQuFXJanPZQOsPaw6Y=; b=sYgX4VYXj49q96V88oDey85to79aH7xbSJcJVitnP/OUJ2vz6NvtITY0gxPrpj7htt /i/QIRN3V07sAqCNE1YFE+3W9JmYFIGCpNeUn1BFkt92QMpcjx8XDdx2VLJkn3n0uWgd ssx8CVbx6VCvZHqocgglS7ZIJFG9U7XeucTlGuPBeG3D/NjH/E5nXWpaquSs5YsF6DWp jyeqSrfCcIPxvjOevlYhRM+8IrKs5OtYAWYy15zE/KEklQChnB1grgsiws7gVh451ZB4 Lcd+fBQKa2hPrOpty4U55d1/+oNJZMnTd3RK8WIsw1F5UdNgKuxiiw4lPPyiZgwAMJtm J9QQ== X-Gm-Message-State: APt69E1K0rWfLw/1P4cBOvO5bsDOkj0UZWf9lfam1w0O3Zj7N6fjESqc 8AgqsiZtKLGj6mjJZzxzjGI= X-Google-Smtp-Source: AAOMgpdPgSrVsGAKpqB3uEL1zoUIQgX09a40IbWWpRs9Xw5PD5wY8W6evXhi/UVxI9XUOu/O3eePbg== X-Received: by 2002:ac8:31e:: with SMTP id q30-v6mr14208274qtg.255.1531005800866; Sat, 07 Jul 2018 16:23:20 -0700 (PDT) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id p125-v6sm7460110qkd.29.2018.07.07.16.23.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 07 Jul 2018 16:23:20 -0700 (PDT) Date: Sat, 7 Jul 2018 20:23:17 -0300 From: Rodrigo Siqueira To: Petri Latvala , Arkadiusz Hiler Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180622 Subject: [Intel-gfx] [PATCH i-g-t 4/7] Fix truncate string in the snprintf X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP This patch fix the following GCC warning: intel_reg.c: In function ‘dump_decode’: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=] snprintf(decode, sizeof(decode), "\n%s", bin); intel_reg.c:203:3: note: ‘snprintf’ output between 2 and 1025 bytes into a destination of size 1024 [..] Signed-off-by: Rodrigo Siqueira --- tools/intel_reg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/intel_reg.c b/tools/intel_reg.c index ddff2794..15ebb86a 100644 --- a/tools/intel_reg.c +++ b/tools/intel_reg.c @@ -180,7 +180,7 @@ static void to_binary(char *buf, size_t buflen, uint32_t val) static void dump_decode(struct config *config, struct reg *reg, uint32_t val) { - char decode[1024]; + char decode[2060]; char tmp[1024]; char bin[1024];