This is the mail archive of the libc-alpha@sourceware.org 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]
Other format: [Raw text]

[PATCH] Properly display unavailable elements in LC_MONETARY category


On architectures with unsigned characters the elements were displayed as
255 instead of -1.

Andreas.

	* locale/programs/locale.c (show_info): Check for CHAR_MAX instead
	of '\177'.
---
 locale/programs/locale.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/locale/programs/locale.c b/locale/programs/locale.c
index 14d34e6..4f8734c 100644
--- a/locale/programs/locale.c
+++ b/locale/programs/locale.c
@@ -895,7 +895,7 @@ show_info (const char *name)
 	      printf ("%s=", item->name);
 
 	    if (val != NULL)
-	      printf ("%d", *val == '\177' ? -1 : *val);
+	      printf ("%d", *val == CHAR_MAX ? -1 : *val);
 	    putchar ('\n');
 	  }
 	  break;
@@ -909,12 +909,12 @@ show_info (const char *name)
 
 	    while (cnt > 1)
 	      {
-		printf ("%d;", *val == '\177' ? -1 : *val);
+		printf ("%d;", *val == CHAR_MAX ? -1 : *val);
 		--cnt;
 		++val;
 	      }
 
-	    printf ("%d\n", cnt == 0 || *val == '\177' ? -1 : *val);
+	    printf ("%d\n", cnt == 0 || *val == CHAR_MAX ? -1 : *val);
 	  }
 	  break;
 	case word:
-- 
1.8.4.3

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


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