Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <20155.194.7.240.2.1074684819.squirrel@webmail.advalvas.be> Date: Wed, 21 Jan 2004 12:33:39 +0100 (CET) Subject: BUG: mbsrtowcs does not conform to spec From: lode DOT leroy AT advalvas DOT be To: cygwin AT cygwin DOT com User-Agent: SquirrelMail/1.4.1 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit The spec says that mbsrtowcs() should return the length of the string _even_when_the_output_buffer_is_NULL_ . currently mbsrtowcs(NULL, ...) returns 0. #include #include #include main() { int len; char* s = "test"; mbstate_t mbstate; memset(&mbstate, 0, sizeof(mbstate)); len = mbsrtowcs(NULL, (const char **)&s, 0, &mbstate); printf("s='%s' - strlen(s)=%d - mbstowcs(s)=%d\n", s, strlen(s), len); } cygwin$ ./mbsrtowcs s='test' - strlen(s)=4 - mbstowcs(s)=0 linux$ ./mbsrtowcs s='test' - strlen(s)=4 - mbstowcs(s)=4 ---------------------------------------------------------------------------------- Plaats je zoekertjes GRATIS op AdValvas Placez votre petite annonce GRATUITEMENT sur AdValvas http://www.advalvas.be -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/