[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#36059: libc6: towlower() does the same as towupper()



Package: libc6
Version: 2.1.1-0.1

In glibc-2.1.1/wctype/wcfuncs.c, towlower() uses __ctype_toupper.
It should use __ctype_tolower.

-- Begin wcbug.c
#include <stdio.h>
#include <wctype.h>

int
main(void)
{
  /* parentheses around function names avoid macro versions */
  printf("towupper(L'X') == L'%lc'\n", (towupper)(L'X'));
  printf("towupper(L'x') == L'%lc'\n", (towupper)(L'x'));
  printf("towlower(L'X') == L'%lc'\n", (towlower)(L'X'));
  printf("towlower(L'x') == L'%lc'\n", (towlower)(L'x'));
  return 0;
}
-- End wcbug.c

-- Begin session
bash-2.02$ gcc -Wall wcbug.c -o wcbug
wcbug.c: In function `main':
wcbug.c:8: warning: long int format, int arg (arg 2)
wcbug.c:9: warning: long int format, int arg (arg 2)
wcbug.c:10: warning: long int format, int arg (arg 2)
wcbug.c:11: warning: long int format, int arg (arg 2)
bash-2.02$ ./wcbug
towupper(L'X') == L'X'
towupper(L'x') == L'X'
towlower(L'X') == L'X'
towlower(L'x') == L'X'
bash-2.02$ 
-- End session

-- System Information
Debian Release: potato
Kernel Version: Linux PC486 2.2.5 #1 ke maalis 31 11:09:56 EEST 1999 i486 unknown

Versions of the packages libc6 depends on:
ii  ldso            1.9.10-1.1     The Linux dynamic linker, library and utilit

Other related packages:
ii  gcc             2.91.63-1.1    The GNU (egcs) C compiler.


Reply to: