www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2007/06/27/07:45:45

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Esa A E Peuha <esa DOT peuha AT helsinki DOT fi>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Bug in mbstowcs() in DJGPP's C library
Date: 27 Jun 2007 14:40:29 +0300
Organization: University of Helsinki
Lines: 16
Message-ID: <86pr6nxvd5e.fsf@sirppi.helsinki.fi>
References: <ioF*uuQNr AT news DOT chiark DOT greenend DOT org DOT uk> <86pabupynhr DOT fsf AT sirppi DOT helsinki DOT fi> <33k383ptj4ch90bdt8fs8jiakcjovmojef AT 4ax DOT com>
NNTP-Posting-Host: sirppi.helsinki.fi
X-Trace: oravannahka.helsinki.fi 1182944429 17445 128.214.205.27 (27 Jun 2007 11:40:29 GMT)
X-Complaints-To: abuse AT helsinki DOT fi
NNTP-Posting-Date: 27 Jun 2007 11:40:29 GMT
X-Newsreader: Gnus v5.6.43/Emacs 19.34
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Brian Inglis <Brian DOT Inglis AT SystematicSW DOT Invalid> writes:

> mbstowcs() should be using the support(ed) function mbtowc() to do wide
> character conversion to "do the right thing" and allow mbs and wcs
> support to be added to the lower level function in future. 

No, mbstowcs() must not call mbtowc() directly; instead, they should
both call another function which does the actual conversion.  The reason
for this is that mbtowc() must preserve shift state across calls, and
neither mbstowcs() nor any other library function is allowed to change
it.  The same requirement applies to wcstombs() and wctomb().

-- 
Esa Peuha
student of mathematics at the University of Helsinki
http://www.helsinki.fi/~peuha/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019