From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Kosina Subject: Re: [PATCH v2] Bluetooth: hidp: using strlcpy instead of strncpy, also beautify code. Date: Thu, 9 May 2013 10:42:15 +0200 (CEST) Message-ID: References: <518906A8.7060708@asianux.com> <5189A417.503@asianux.com> <5189C7C6.8090408@asianux.com> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: David Herrmann , Marcel Holtmann , Johan Hedberg , David Miller , andrei.emeltchenko-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, "linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , netdev To: Chen Gang , Gustavo Padovan Return-path: In-Reply-To: <5189C7C6.8090408-bOixZGp5f+dBDgjK7y7TUQ@public.gmane.org> Sender: linux-bluetooth-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org On Wed, 8 May 2013, Chen Gang wrote: > > For NUL terminated string, need always let it ended by zero. > > Since have already called memcpy() to initialize 'ci', so need not > redundent initializations. > > Better use ''if(session->hid) {} else if(session->input) {}'' instead > of ''if(session->hid) {}; if(session->input) {};'' > > Signed-off-by: Chen Gang Makes sense. Acked-by: Jiri Kosina Gustavo, going to take this, please? -- Jiri Kosina SUSE Labs