/* Convert multibyte character to wide character.
- Copyright (C) 1999-2002, 2005-2010 Free Software Foundation, Inc.
+ Copyright (C) 1999-2002, 2005-2011 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This program is free software: you can redistribute it and/or modify
{
char *pstate = (char *)ps;
- if (pstate == NULL)
- pstate = internal_state;
-
if (s == NULL)
{
pwc = NULL;
return (size_t)(-2);
/* Here n > 0. */
+
+ if (pstate == NULL)
+ pstate = internal_state;
+
{
size_t nstate = pstate[0];
char buf[4];
{
static mbstate_t internal_state;
- /* Override mbrtowc's internal state. We can not call mbsinit() on the
+ /* Override mbrtowc's internal state. We cannot call mbsinit() on the
hidden internal state, but we can call it on our variable. */
if (ps == NULL)
ps = &internal_state;