This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

nl_langinfo (_NL_PAPER_HEIGHT) problem



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]