This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
nl_langinfo (_NL_PAPER_HEIGHT) problem
- To: libc-alpha at sources dot redhat dot com
- Subject: nl_langinfo (_NL_PAPER_HEIGHT) problem
- From: Andreas Jaeger <aj at suse dot de>
- Date: 24 Apr 2001 15:24:20 +0200
- Cc: Werner Fink <werner at suse dot de>
The output of the appended program is:
gee:/tmp:[1]$ gcc -Wall -g t.c
gee:/tmp:[0]$ ./a.out
297
Segmentation fault
According to the documentation and to Unix98, nl_langinfo returns a
string - but it seems that glibc returns in this case an integer?
This looks broken to me.
Andreas
#include <locale.h>
#include <langinfo.h>
#include <stdio.h>
int
main (void)
{
char *p;
setlocale (LC_ALL, "");
p = nl_langinfo (_NL_PAPER_HEIGHT);
printf ("%d\n", (int)p);
printf ("%p %s\n", p, p);
return 0;
}
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj