From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S940161AbdDSWPd (ORCPT ); Wed, 19 Apr 2017 18:15:33 -0400 Received: from mail-yw0-f196.google.com ([209.85.161.196]:33236 "EHLO mail-yw0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936709AbdDSWPb (ORCPT ); Wed, 19 Apr 2017 18:15:31 -0400 MIME-Version: 1.0 In-Reply-To: References: <20170419171543.3274995-1-arnd@arndb.de> From: Arnd Bergmann Date: Thu, 20 Apr 2017 00:15:30 +0200 X-Google-Sender-Auth: v39nySsxIFh8oR5xWWjgrQMe4xk Message-ID: Subject: Re: [PATCH] [media] rainshadow-cec: use strlcat instead of strncat To: Hans Verkuil Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 19, 2017 at 11:14 PM, Hans Verkuil wrote: > On 19/04/17 19:15, Arnd Bergmann wrote: >> gcc warns about an obviously incorrect use of strncat(): >> >> drivers/media/usb/rainshadow-cec/rainshadow-cec.c: In function 'rain_cec_adap_transmit': >> drivers/media/usb/rainshadow-cec/rainshadow-cec.c:299:4: error: specified bound 48 equals the size of the destination [-Werror=stringop-overflow=] >> >> It seems that strlcat was intended here, and using that makes the >> code correct. > > Oops! You're right, it should be strlcat. > > Which gcc version do you use? Mine (6.3.0) didn't give an error (or warning, for that matter). I think the warning was only added in gcc-7.0.1. Arnd