Skip to content

Commit

Permalink
[BZ #9677]
Browse files Browse the repository at this point in the history
2008-12-21  Bruno Haible  <bruno@clisp.org>
	[BZ #9677]
	* wcsmbs/mbsnrtowcs.c (__mbsnrtowcs): Create temporary state object
	if no output is written.
  • Loading branch information
Ulrich Drepper committed Dec 26, 2008
1 parent f38113e commit bf93cd3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2008-12-21 Bruno Haible <bruno@clisp.org>

[BZ #9677]
* wcsmbs/mbsnrtowcs.c (__mbsnrtowcs): Create temporary state object
if no output is written.

2008-12-13 Klaus Dittrich <kladit@arcor.de>

* login/utmp_file.c (pututline_file): Replace call to dup2 with
Expand Down
2 changes: 1 addition & 1 deletion localedata/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
2008-12-26 Ulrich Drepper <drepper@redhat.com>

* tests-mbwc/tst_types.h (TIN)MBRLEN_REC): Use correct array
* tests-mbwc/tst_types.h (TIN_MBRLEN_REC): Use correct array
length constant.

2008-12-05 Ulrich Drepper <drepper@redhat.com>
Expand Down
6 changes: 5 additions & 1 deletion wcsmbs/mbsnrtowcs.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1996-2000, 2002, 2005 Free Software Foundation, Inc.
/* Copyright (C) 1996-2000, 2002, 2005, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
Expand Down Expand Up @@ -79,9 +79,13 @@ __mbsnrtowcs (dst, src, nmc, len, ps)
/* We have to handle DST == NULL special. */
if (dst == NULL)
{
mbstate_t temp_state;
wchar_t buf[64]; /* Just an arbitrary size. */
const unsigned char *inbuf = (const unsigned char *) *src;

temp_state = *data.__statep;
data.__statep = &temp_state;

result = 0;
data.__outbufend = (unsigned char *) buf + sizeof (buf);
do
Expand Down

0 comments on commit bf93cd3

Please sign in to comment.