Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757482AbZKNDsJ (ORCPT ); Fri, 13 Nov 2009 22:48:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757319AbZKNDsI (ORCPT ); Fri, 13 Nov 2009 22:48:08 -0500 Received: from mail.perches.com ([173.55.12.10]:1053 "EHLO mail.perches.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757298AbZKNDsH (ORCPT ); Fri, 13 Nov 2009 22:48:07 -0500 Subject: Re: [PATCH 3/4] security/selinux: decrement sizeof size in strncmp From: Joe Perches To: David Wagner Cc: linux-kernel@vger.kernel.org In-Reply-To: References: <4AFCC06B.1030302@schaufler-ca.com> <19857.1258147396@turing-police.cc.vt.edu> <4AFE1EA9.60102@schaufler-ca.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 13 Nov 2009 19:48:11 -0800 Message-ID: <1258170491.16857.142.camel@Joe-Laptop.home> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 664 Lines: 15 On Sat, 2009-11-14 at 03:44 +0000, David Wagner wrote: > I personally don't find > strncmp(foo, "constant", sizeof("constant")) // first snippet > to be more readable, auditable, or obviously correct than > strcmp(foo, "constant"). // second snippet > Is there a technical basis for arguing that the first > snippet is better than the second snippet? I don't think there is. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/