From owner-freebsd-current@FreeBSD.ORG Thu Jun 21 15:42:06 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 8AA001065679 for ; Thu, 21 Jun 2012 15:42:06 +0000 (UTC) (envelope-from demelier.david@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 175B18FC17 for ; Thu, 21 Jun 2012 15:42:05 +0000 (UTC) Received: by eeke49 with SMTP id e49so412926eek.13 for ; Thu, 21 Jun 2012 08:42:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=AzUGVqbQ6XoZb5DsM5mkprQiS1x00zXWl2jHtiQEA3o=; b=DPdw+uCfVYymKAf5brKTROTilSsqUjevzs3FgZ4HlfC5Wctm+Hny8LjisLvBMwTNfO HaHdqR6BCAZK97Hff00ST3atGTngLPVI9V4+HQ8LasU60MjHH4UrQBWDZB4svnI0BrDb Rm/g+NXbeTHq2o2hpMst4D/fwxVgF363b4CE3M2ceMZ5S+uyAvIy3O+o9XWubYR2kcH0 njZ3ghtvb/1NIUfcoR4nUNgTFixtji+a7Caj5bihttST12JSynk3bzmRKzd1pao3CA4M a7LltZMbJPMUxYHvIOn+WNIExEhleU0fvt+8RXj8kJ0P1euTK4I7MEoFypKhxhA9YkG5 Y02g== Received: by 10.14.48.66 with SMTP id u42mr6045735eeb.195.1340293324924; Thu, 21 Jun 2012 08:42:04 -0700 (PDT) Received: from Groseille.malikania.fr (197.21.102.84.rev.sfr.net. [84.102.21.197]) by mx.google.com with ESMTPS id c51sm104013336eei.12.2012.06.21.08.42.03 (version=SSLv3 cipher=OTHER); Thu, 21 Jun 2012 08:42:03 -0700 (PDT) Message-ID: <4FE340D3.6040004@gmail.com> Date: Thu, 21 Jun 2012 17:42:11 +0200 From: David Demelier User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120602 Thunderbird/12.0.1 MIME-Version: 1.0 To: Sergey Kandaurov References: <4FE315B6.9020102@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Thu, 21 Jun 2012 18:22:58 +0000 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 15:42:06 -0000 On 21/06/2012 14:55, Sergey Kandaurov wrote: > On 21 June 2012 16:38, David Demelier wrote: >> Hello, >> >> While reading the manpage of mbstowcs I noticed an error in the RETURN >> VALUES : >> >> The mbstowcs() function returns the number of wide characters converted, >> not counting any terminating null wide character, or -1 if an invalid >> 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. > Yes that is very strange, iconv(3) do it too. -- David Demelier