[Bug 839] New: cal produces garbled week-day names when locale is Japan or Taiwan
bugzilla at busybox.net
bugzilla at busybox.net
Sun Jan 3 09:55:43 UTC 2010
https://bugs.busybox.net/show_bug.cgi?id=839
Summary: cal produces garbled week-day names when locale is Japan
or Taiwan
Product: Busybox
Version: 1.16.x
Platform: PC
OS/Version: Linux
Status: NEW
Keywords: FIXME
Severity: major
Priority: P3
Component: Other
AssignedTo: unassigned at busybox.net
ReportedBy: cookie at ms93.url.com.tw
CC: busybox-cvs at busybox.net
Estimated Hours: 0.0
Dear Sir/Madam,
cal produces garbled week-day names when locale is zh_TW.utf8 or
ja_JP.utf8, although it works well when locale is C. Please refer to the
upper-left window in attached PNG file for details.
After tracing the code, I found that the bug is located in line 126 of
coreutils/cal.c of version 1.16.0.git. It seems to be inappropriate for
strncpy to copy the first 2 bytes in buf when locale is zh_TW.utf8 or
ja_JP.utf8.
/* code segment: from line 124 to line 126 of coreutils/cal.c of v1.16.0.git */
zero_tm.tm_wday = i;
strftime(buf, sizeof(buf), "%a", &zero_tm);
strncpy(day_headings + i * (3+julian) + julian, buf, 2);
By the way, my OS is Quirky Linux v0.0.2, which is a variant of Puppy
Linux.
Best regards,
CHIN-YUAN KUO
Jan. 3, 2010
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the busybox-cvs
mailing list