From owner-freebsd-current Sat Sep 14 15:10:20 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id PAA10961 for current-outgoing; Sat, 14 Sep 1996 15:10:20 -0700 (PDT) Received: from freebsd.gaffaneys.com (dialup2.gaffaneys.com [134.129.252.21]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id PAA10955 for ; Sat, 14 Sep 1996 15:10:13 -0700 (PDT) Received: (from zach@localhost) by freebsd.gaffaneys.com (8.7.5/8.7.3) id RAA15282; Sat, 14 Sep 1996 17:13:31 -0500 (CDT) To: Wolfram Schneider Cc: current@FreeBSD.org Subject: Re: str*cmp References: <199609141943.VAA02898@campa.panke.de> From: Zach Heilig Date: 14 Sep 1996 17:13:30 -0500 In-Reply-To: Wolfram Schneider's message of Sat, 14 Sep 1996 21:43:43 +0200 Message-ID: <87d8zoiw39.fsf@freebsd.gaffaneys.com> Lines: 27 X-Mailer: Gnus v5.3/Emacs 19.34 Sender: owner-current@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk Wolfram Schneider writes: > src/lib/libc/string/strcmp.c > int > strcmp(s1, s2) > register const char *s1, *s2; > { > while (*s1 == *s2++) > if (*s1++ == 0) > ^^^^^^^^^^ > should be (*s1++ == '\0') Actually, this is a style issue. '\0' is an 'int' with the value zero, exacly like 0 is an 'int' with the value zero. If you look in the standard, you will note that '\' (or '\x') is a integer with the literal value of whatever '' (or ) is. '\0' is simply an octal integer constant with the value 0 (made up to LOOK like a character constant). C++ is a bit different because '\0' is really a 'char' (still 0 valued), but since both languages do type conversions as necessary, there is no problems caused by that bit of code. -- Zach Heilig (zach@blizzard.gaffaneys.com) | ALL unsolicited commercial email Support bacteria -- it's the | is unwelcome. I avoid dealing only culture some people have! | with companies that email ads.