From owner-svn-src-all@FreeBSD.ORG Mon Sep 19 22:49:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5905106566B; Mon, 19 Sep 2011 22:49:36 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4B5B8FC08; Mon, 19 Sep 2011 22:49:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8JMnaMQ099384; Mon, 19 Sep 2011 22:49:36 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8JMnasC099382; Mon, 19 Sep 2011 22:49:36 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201109192249.p8JMnasC099382@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 19 Sep 2011 22:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225678 - head/lib/libc/iconv 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 Sep 2011 22:49:36 -0000 Author: gabor Date: Mon Sep 19 22:49:36 2011 New Revision: 225678 URL: http://svn.freebsd.org/changeset/base/225678 Log: - Fix a trivial bug in iconv. When there is no space to perform the conversion, conversion must fail and errno must be set to E2BIG. PR: standards/160673 Submitted by: Henning Petersen Reviewed by: pluknet Approved by: re (kib), delphij (mentor) Modified: head/lib/libc/iconv/citrus_none.c Modified: head/lib/libc/iconv/citrus_none.c ============================================================================== --- head/lib/libc/iconv/citrus_none.c Mon Sep 19 22:35:54 2011 (r225677) +++ head/lib/libc/iconv/citrus_none.c Mon Sep 19 22:49:36 2011 (r225678) @@ -190,7 +190,6 @@ _citrus_NONE_stdenc_wctomb(struct _citru void * __restrict pspriv __unused, size_t * __restrict nresult, struct iconv_hooks *hooks __unused) { - int ret; if ((wc & ~0xFFU) != 0) { *nresult = (size_t)-1; @@ -198,7 +197,7 @@ _citrus_NONE_stdenc_wctomb(struct _citru } if (n == 0) { *nresult = (size_t)-1; - ret = E2BIG; + return (E2BIG); } *nresult = 1;