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

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix locale printing on 64-bit big-endian arches


Hi!

2003-10-23  Jakub Jelinek  <jakub@redhat.com>

	* locale/programs/locale.c (show_info): Fix printing word values on
	64-bit big-endian architectures.

--- libc/locale/programs/locale.c.jj	2003-05-22 02:40:45.000000000 +0200
+++ libc/locale/programs/locale.c	2003-10-23 21:46:06.000000000 +0200
@@ -893,12 +893,12 @@ show_info (const char *name)
 	  break;
 	case word:
 	  {
-	    unsigned int val =
-	      (unsigned int) (unsigned long int) nl_langinfo (item->item_id);
+	    union { unsigned int word; char *string; } val;
+	    val.string = nl_langinfo (item->item_id);
 	    if (show_keyword_name)
 	      printf ("%s=", item->name);
 
-	    printf ("%d\n", val);
+	    printf ("%d\n", val.word);
 	  }
 	  break;
 	case wstring:

	Jakub


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