From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 02:17:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8F2C21065677 for ; Mon, 19 Mar 2012 02:17:30 +0000 (UTC) (envelope-from jhellenthal@dataix.net) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 24EAA8FC12 for ; Mon, 19 Mar 2012 02:17:29 +0000 (UTC) Received: by iahk25 with SMTP id k25so12226953iah.13 for ; Sun, 18 Mar 2012 19:17:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dataix.net; s=rsa; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to; bh=KDtC/0ktxJp3vDQXpYtToV/w65BZ79QDpxSAqPsGKDo=; b=X0OhXvNoxcbHK//VoSAWFL4w/mQnff4Rkc4fHDHLoaLF1T/GfQNuGnZhaGWDnktxi7 w5Ekwsd1WoKun2oO4ibCTI1ducZDYnRn+uqgU3r3trIfNmp3lb2mUw5RUbHv/4/1LZu3 D/fxU9jlCuC+vzgcCeqhu/c1bSaqFl6w40hQg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:x-gm-message-state; bh=KDtC/0ktxJp3vDQXpYtToV/w65BZ79QDpxSAqPsGKDo=; b=GI4Fs314JMcJDzUydQ6CMefzpighhOY4gHy6EEd6mpZiDn6qTDCYPaGf7eYYKD8vdd WMdv8lW+GSEzUGswji3yc+q8/CMhQyzw8Yhlvb7ApaLiz+lalLHzIgYGliCwUQuR1IJ9 J7kBV2CBFD0Uzl4a+y+YjhTc3XDdAIRR3Zxwdm5s7o5VsxWRCOPbURl38hNvh6Sj7JCL 9gdu4QUW7yiFIZNsHxNkEXtI3lNXgv2XzEroKOnYgYqox0JuooDtZbqQkKV02EOH29sN nsz5tSEuWi4oL9lLMUQoWUDZ31uHRNtOOY1lnsZ19M7FJF7xRl+xOCrG4wapdKzsojGD 9vSQ== Received: by 10.43.52.10 with SMTP id vk10mr5781188icb.25.1332123449452; Sun, 18 Mar 2012 19:17:29 -0700 (PDT) Received: from DataIX.net (adsl-99-112-214-41.dsl.klmzmi.sbcglobal.net. [99.112.214.41]) by mx.google.com with ESMTPS id gh8sm4997814igb.16.2012.03.18.19.17.27 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 18 Mar 2012 19:17:28 -0700 (PDT) Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id q2J2HPJA002608 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 18 Mar 2012 22:17:25 -0400 (EDT) (envelope-from jhellenthal@DataIX.net) Received: (from jhellenthal@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id q2J2HOUS002134; Sun, 18 Mar 2012 22:17:24 -0400 (EDT) (envelope-from jhellenthal@DataIX.net) Date: Sun, 18 Mar 2012 22:17:24 -0400 From: Jason Hellenthal To: Eitan Adler Message-ID: <20120319021724.GC13456@DataIX.net> References: <201203190127.q2J1RtgB044557@svn.freebsd.org> <20120319015203.GB13456@DataIX.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Gm-Message-State: ALoCoQnsJEIq/4lx9tAkkoN+BfDN9DiLqNAti03EJ6hE8iD0PMf9G1s6jQo17jNdrxj5sgjhBSJo Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r233147 - stable/8/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 02:17:30 -0000 On Sun, Mar 18, 2012 at 09:58:12PM -0400, Eitan Adler wrote: > On Sun, Mar 18, 2012 at 9:52 PM, Jason Hellenthal > wrote: > > > > > > On Mon, Mar 19, 2012 at 01:27:55AM +0000, Eitan Adler wrote: > >> Author: eadler > >> Date: Mon Mar 19 01:27:55 2012 > >> New Revision: 233147 > >> URL: http://svn.freebsd.org/changeset/base/233147 > >> > >> Log: > >>   MFC r232503: > >>       POSIX mandates that swab do nothing when len < 0 > >> > >>   PR:         140690 > >>   Approved by:        cperciva > >> > >> Modified: stable/8/lib/libc/string/swab.c > >> ============================================================================== > >> --- stable/8/lib/libc/string/swab.c   Mon Mar 19 01:27:30 2012        (r233146) > >> +++ stable/8/lib/libc/string/swab.c   Mon Mar 19 01:27:55 2012        (r233147) > >> @@ -45,6 +45,8 @@ swab(const void * __restrict from, void > >>       int n; > >>       char *fp, *tp; > >> > >> +     if (len <= 0) > >> +             return; > > > > Does this not test to see if it is also equal to 0(zero) ? > > > > If I understand the above statement "POSIX mandates that swab do nothing > > when len < 0" then the above code should be exactly that ... and not > > testing whether it is equal to zero... > > If the code doesn't check for len <= 0 then it will do something. > To my understanding of the specification it should only return if len is negative... 0 is not a negative number. -- ;s =;