From owner-freebsd-current@FreeBSD.ORG Thu Jun 21 12:55:17 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AF76106566C for ; Thu, 21 Jun 2012 12:55:17 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id D83C98FC16 for ; Thu, 21 Jun 2012 12:55:16 +0000 (UTC) Received: by yenl8 with SMTP id l8so475675yen.13 for ; Thu, 21 Jun 2012 05:55:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=mOmTikyYbgZNn1rcohMTbQpIwkHPlVmyyJ9eZloSBEc=; b=0vXEBPXjT4ChTq2MXbMUHp0MyiT0q0pBzT2H05+lYSjdmjcRnxxdJxD/CdAxdJR5um OAAn1f4XOueLlIjErbDHER3P7oGkSNQA8j7WngbXqjFHXhkVVUES2MoQ4LX5MbOyBIxx 9iUHtR+iEJYb4K/DzpqQpXDdUuSk130F6Mo1C/7X1YaLGm1uX08HBiSuY015IOPm54W2 DPA+nAWX2iPuomsCiHIuI2nCIncKNWRfMkdUlF+amk3ogh7tmzPLdF+ACEE833E+iinl Qr/hWICpltPorJ5UgynLv5BRPeKM3P1v7TwPGJc5wBeC4KHe9dibuy+s90fcMlN+HmCq MsRg== MIME-Version: 1.0 Received: by 10.50.160.202 with SMTP id xm10mr7285724igb.10.1340283315326; Thu, 21 Jun 2012 05:55:15 -0700 (PDT) Received: by 10.64.8.170 with HTTP; Thu, 21 Jun 2012 05:55:15 -0700 (PDT) In-Reply-To: <4FE315B6.9020102@gmail.com> References: <4FE315B6.9020102@gmail.com> Date: Thu, 21 Jun 2012 16:55:15 +0400 Message-ID: From: Sergey Kandaurov To: David Demelier Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: Re: mbstowcs(3) may not return -1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 12:55:17 -0000 On 21 June 2012 16:38, David Demelier wrote: > Hello, > > While reading the manpage of mbstowcs I noticed an error in the RETURN > VALUES : > > =A0 =A0 The mbstowcs() function returns the number of wide characters con= verted, > =A0 =A0 not counting any terminating null wide character, or -1 if an inv= alid > =A0 =A0 multibyte character was encountered. > > Since size_t is unsigned, it can't returns -1. It returns (size_t)(-1). I don't know how is it correct, but this conforms to C spec. --=20 wbr, pluknet