Bug 1041 - swprintf failed to convert %s format in some condition.
Summary: swprintf failed to convert %s format in some condition.
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.3.5
: P2 normal
Target Milestone: ---
Assignee: GOTO Masanori
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-01 13:04 UTC by Eungkyu Song
Modified: 2005-09-22 17:46 UTC (History)
1 user (show)

See Also:
Host: i386
Target:
Build:
Last reconfirmed:


Attachments
sample swprintf program (269 bytes, text/x-csrc)
2005-07-01 13:06 UTC, Eungkyu Song
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eungkyu Song 2005-07-01 13:04:15 UTC
This attached program failed when last character of string is alphabet or number.
I'm running in ko_KR.UTF-8 locale.

for example, 

$ locale
LANG=ko_KR.UTF-8
LC_CTYPE="ko_KR.UTF-8"
LC_NUMERIC="ko_KR.UTF-8"
LC_TIME="ko_KR.UTF-8"
LC_COLLATE="ko_KR.UTF-8"
LC_MONETARY="ko_KR.UTF-8"
LC_MESSAGES="ko_KR.UTF-8"
LC_PAPER="ko_KR.UTF-8"
LC_NAME="ko_KR.UTF-8"
LC_ADDRESS="ko_KR.UTF-8"
LC_TELEPHONE="ko_KR.UTF-8"
LC_MEASUREMENT="ko_KR.UTF-8"
LC_IDENTIFICATION="ko_KR.UTF-8"
LC_ALL=
$./swprintfbug °¡³ª´Ù
°¡³ª´Ù
$ ./swprintfbug 123
Error occured in swprintf
$ ./swprintfbug abc
Error occured in swprintf
$ ./swprintfbug 123°¡³ª´Ù
123°¡³ª´Ù
Comment 1 Eungkyu Song 2005-07-01 13:06:04 UTC
Created attachment 532 [details]
sample swprintf program
Comment 2 Ulrich Drepper 2005-09-22 17:46:54 UTC
The program code is wrong.  swprintf will flag an array if the output array is
too small which is always the case for this caode when given ASCII input.