about summary refs log tree commit diff
path: root/locale/programs/ld-monetary.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-07-28 20:45:36 +0000
committerUlrich Drepper <drepper@redhat.com>2007-07-28 20:45:36 +0000
commitcedb4109571cff4416235df260848de77f09f556 (patch)
treee170e2abca7478ed85d71a5efe34f861a112b90a /locale/programs/ld-monetary.c
parent9d9febc7952c43f90fd81ce185e4b1a74cb13375 (diff)
downloadglibc-cedb4109571cff4416235df260848de77f09f556.tar.gz
glibc-cedb4109571cff4416235df260848de77f09f556.tar.xz
glibc-cedb4109571cff4416235df260848de77f09f556.zip
* locale/programs/ld-monetary.c (monetary_finish): Avoid range check
	for int_frac_digits and frac_digits.

	* login/logout.c (logout): Avoid aliasing violation.
	* login/logwtmp.c (logwtmp): Likewise.

	* libio/genops.c (_IO_un_link): Avoid aliasing violation.
Diffstat (limited to 'locale/programs/ld-monetary.c')
-rw-r--r--locale/programs/ld-monetary.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/locale/programs/ld-monetary.c b/locale/programs/ld-monetary.c
index e2634bc2c9..b8d291e7fc 100644
--- a/locale/programs/ld-monetary.c
+++ b/locale/programs/ld-monetary.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995-1999,2000,2001,2002,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1999,2000,2001,2002,2005,2007
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
 
@@ -279,13 +280,14 @@ not correspond to a valid name in ISO 4217"),
        monetary->cat = initval;						      \
     }									      \
   else if ((monetary->cat < min || monetary->cat > max)			      \
+	   && min < max							      \
 	   && !be_quiet && !nothing)					      \
     WITH_CUR_LOCALE (error (0, 0, _("\
 %s: value for field `%s' must be in range %d...%d"),			      \
 			    "LC_MONETARY", #cat, min, max))
 
-  TEST_ELEM (int_frac_digits, -128, 127, -1);
-  TEST_ELEM (frac_digits, -128, 127, -1);
+  TEST_ELEM (int_frac_digits, 1, 0, -1);
+  TEST_ELEM (frac_digits, 1, 0, -1);
   TEST_ELEM (p_cs_precedes, -1, 1, -1);
   TEST_ELEM (p_sep_by_space, -1, 2, -1);
   TEST_ELEM (n_cs_precedes, -1, 1, -1);