Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 21 Sep 2002 15:23:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 21 Sep 2002 15:23:17 -0400 Received: from modemcable166.48-200-24.mtl.mc.videotron.ca ([24.200.48.166]:27094 "EHLO xanadu.home") by vger.kernel.org with ESMTP id ; Sat, 21 Sep 2002 15:23:17 -0400 Date: Sat, 21 Sep 2002 15:28:22 -0400 (EDT) From: Nicolas Pitre X-X-Sender: nico@xanadu.home To: Dan Aloni cc: lkml Subject: Re: [PATCH] fix to strchr() in lib/string.c In-Reply-To: <20020921173033.GB19943@callisto.yi.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 919 Lines: 29 On Sat, 21 Sep 2002, Dan Aloni wrote: > On Sat, Sep 21, 2002 at 12:25:59PM -0400, Nicolas Pitre wrote: > > > > The return value of strchr("foo",0) should be the start address of > > "foo" + 3, not NULL. > > Correct me if I'm wrong, but no fix is needed. > > strchr("foo", 0) doesn't return NULL, for the simple fact that > the loop will stop when reaching '\0' before the 'if' that returns > NULL, and then s will be returned. Doh. You're right. I was fixing some architecture specific version and someone I usually trust led me to believe this one was broken too, and I obviously didn't look carefully enough. (no no I won't say it was you Russell) ;-) Nicolas - 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/