Skip to content

Commit

Permalink
* wcsmbs/wcsnrtombs.c (__wcsnrtombs): Create temporary state object
Browse files Browse the repository at this point in the history
	if no output is written.
  • Loading branch information
Ulrich Drepper committed Jan 2, 2009
1 parent 623d0bf commit 7209811
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2009-01-02 Ulrich Drepper <drepper@redhat.com>

* wcsmbs/wcsnrtombs.c (__wcsnrtombs): Create temporary state object
if no output is written.

* version.h: Bump to 2.10 development.

* posix/getconf.c: Update copyright year.
Expand Down
4 changes: 4 additions & 0 deletions wcsmbs/wcsnrtombs.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,14 @@ __wcsnrtombs (dst, src, nwc, len, ps)
/* We have to handle DST == NULL special. */
if (dst == NULL)
{
mbstate_t temp_state;
unsigned char buf[256]; /* Just an arbitrary value. */
const unsigned char *inbuf = (const unsigned char *) *src;
size_t dummy;

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

result = 0;
data.__outbufend = buf + sizeof (buf);

Expand Down

0 comments on commit 7209811

Please sign in to comment.