]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Wed, 13 Mar 2002 23:27:20 +0000 (23:27 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 13 Mar 2002 23:27:20 +0000 (23:27 +0000)
2002-03-13  Wolfram Gloger  <wg@malloc.de>

* malloc/malloc.c (sYSMALLOc): Don't change brk if mmap failed.

2002-03-02  Andreas Schwab  <schwab@suse.de>

* stdio-common/vfprintf.c (process_arg): Fix decimal format with
'h' flag and positional arg.
* stdio-common/tst-printf.c (rfg3): New function to test
positional arguments.
(main): Fix some warnings.

2002-03-13  Jakub Jelinek  <jakub@redhat.com>

* elf/dl-minimal.c (_itoa): Use _itoa_lower_digits_internal if SHARED.
* elf/dl-reloc.c (_dl_reloc_bad_type): Likewise.

ChangeLog
elf/dl-minimal.c
elf/dl-reloc.c
malloc/malloc.c
stdio-common/tst-printf.c
stdio-common/vfprintf.c

index bd254a64e493b394070dd54482384342a4dd3ea7..5d346ad116b55aee437433be204f4be72cd4edf6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2002-03-13  Wolfram Gloger  <wg@malloc.de>
+
+       * malloc/malloc.c (sYSMALLOc): Don't change brk if mmap failed.
+
+2002-03-02  Andreas Schwab  <schwab@suse.de>
+
+       * stdio-common/vfprintf.c (process_arg): Fix decimal format with
+       'h' flag and positional arg.
+       * stdio-common/tst-printf.c (rfg3): New function to test
+       positional arguments.
+       (main): Fix some warnings.
+
+2002-03-13  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf/dl-minimal.c (_itoa): Use _itoa_lower_digits_internal if SHARED.
+       * elf/dl-reloc.c (_dl_reloc_bad_type): Likewise.
+
 2002-03-13  Ulrich Drepper  <drepper@redhat.com>
 
        * grp/initgroups.c (__nss_group_data): Declare as hidden.
index abc829b53a25810d1ff1aa6b09d7c283cb069eee..9b9d34b07dc6b3f97343e967586887bd93f4b9e1 100644 (file)
@@ -290,12 +290,12 @@ _itoa (value, buflim, base, upper_case)
      unsigned int base;
      int upper_case;
 {
-  extern const char _itoa_lower_digits[] attribute_hidden;
+  extern const char INTUSE(_itoa_lower_digits)[] attribute_hidden;
 
   assert (! upper_case);
 
   do
-    *--buflim = _itoa_lower_digits[value % base];
+    *--buflim = INTUSE(_itoa_lower_digits)[value % base];
   while ((value /= base) != 0);
 
   return buflim;
@@ -348,4 +348,5 @@ strong_alias (__strsep, __strsep_g)
 
 /* The '_itoa_lower_digits' variable in libc.so is able to handle bases
    up to 36.  We don't need this here.  */
-const char _itoa_lower_digits[16] = "0123456789abcdef";
+const char INTUSE(_itoa_lower_digits)[16] attribute_hidden
+  = "0123456789abcdef";
index 29f302a25a1d98013660189b59248de415d2915b..88bd3b681e86a7b538dfe5780e67bc76d6cc8b00 100644 (file)
@@ -210,8 +210,8 @@ void
 internal_function
 _dl_reloc_bad_type (struct link_map *map, unsigned int type, int plt)
 {
-  extern const char _itoa_lower_digits[] attribute_hidden;
-#define DIGIT(b)       _itoa_lower_digits[(b) & 0xf];
+  extern const char INTUSE(_itoa_lower_digits)[] attribute_hidden;
+#define DIGIT(b)       INTUSE(_itoa_lower_digits)[(b) & 0xf];
 
   /* XXX We cannot translate these messages.  */
   static const char msg[2][32] = { "unexpected reloc type 0x",
index 7414c705a9007f9b3e71d9e6828247ee4ce76a56..059508a95e1643a4f5d129ba8bf3910e1316b783 100644 (file)
@@ -2824,11 +2824,12 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
     /* Don't try if size wraps around 0 */
     if ((unsigned long)(size) > (unsigned long)(nb)) {
 
-      brk = (char*)(MMAP(0, size, PROT_READ|PROT_WRITE, MAP_PRIVATE));
+      char *mbrk = (char*)(MMAP(0, size, PROT_READ|PROT_WRITE, MAP_PRIVATE));
 
-      if (brk != MAP_FAILED) {
+      if (mbrk != MAP_FAILED) {
 
         /* We do not need, and cannot use, another sbrk call to find end */
+        brk = mbrk;
         snd_brk = brk + size;
 
         /*
index e991fd24803b2c20dd52050ff88519644c9077f9..df73fe23847ee809db12b9bdbb705ae3d0ece69c 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,92,93,95,96,97,98,99, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,93,95,96,97,98,99, 2000, 2002
+     Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -30,6 +31,7 @@
 
 static void rfg1 (void);
 static void rfg2 (void);
+static void rfg3 (void);
 
 
 static void
@@ -159,7 +161,7 @@ I am ready for my first lesson today.";
   printf("long octal negative:\t\"%lo\"\n", -2345L);
   printf("long unsigned decimal number:\t\"%lu\"\n", -123456L);
   printf("zero-padded LDN:\t\"%010ld\"\n", -123456L);
-  printf("left-adjusted ZLDN:\t\"%-010ld\"\n", -123456);
+  printf("left-adjusted ZLDN:\t\"%-010ld\"\n", -123456L);
   printf("space-padded LDN:\t\"%10ld\"\n", -123456L);
   printf("left-adjusted SLDN:\t\"%-10ld\"\n", -123456L);
 
@@ -218,8 +220,9 @@ I am ready for my first lesson today.";
     char buf[20];
     char buf2[512];
     printf ("snprintf (\"%%30s\", \"foo\") == %d, \"%.*s\"\n",
-           snprintf (buf, sizeof (buf), "%30s", "foo"), sizeof (buf), buf);
-    printf ("snprintf (\"%%.999999u\", 10)\n",
+           snprintf (buf, sizeof (buf), "%30s", "foo"), (int) sizeof (buf),
+           buf);
+    printf ("snprintf (\"%%.999999u\", 10) == %d\n",
            snprintf(buf2, sizeof(buf2), "%.999999u", 10));
   }
 
@@ -269,6 +272,7 @@ I am ready for my first lesson today.";
   puts ("--- Should be no further output. ---");
   rfg1 ();
   rfg2 ();
+  rfg3 ();
 
   {
     char bytes[7];
@@ -352,3 +356,23 @@ rfg2 (void)
   if (strcmp (buf, " 021") != 0)
     printf ("got: '%s', expected: '%s'\n", buf, " 021");
 }
+
+static void
+rfg3 (void)
+{
+  char buf[100];
+  double g = 5.0000001;
+  unsigned long l = 1234567890;
+  double d = 321.7654321;
+  char *s = "test-string";
+  int i = 12345;
+  int h = 1234;
+
+  sprintf (buf,
+          "%1$*5$d %2$*6$hi %3$*7$lo %4$*8$f %9$*12$e %10$*13$g %11$*14$s",
+          i, h, l, d, 8, 5, 14, 14, d, g, s, 14, 3, 14);
+  if (strcmp (buf,
+             "   12345  1234    11145401322     321.765432   3.217654e+02   5    test-string") != 0)
+    printf ("got: '%s', expected: '%s'\n", buf,
+           "   12345  1234    11145401322     321.765432   3.217654e+02   5    test-string");
+}
index c7c3e83efc7c4fa326605e6fc7a8b11fc15e5d88..a4773468e7799a5a5c7a065a44089c58a88c0bc1 100644 (file)
@@ -581,8 +581,10 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
          else                                                                \
            if (is_long_num)                                                  \
              signed_number = args_value[fspec->data_arg].pa_long_int;        \
-           else                                                              \
+           else if (!is_short)                                               \
              signed_number = args_value[fspec->data_arg].pa_int;             \
+           else                                                              \
+             signed_number = args_value[fspec->data_arg].pa_short_int;       \
                                                                              \
          is_negative = signed_number < 0;                                    \
          number.word = is_negative ? (- signed_number) : signed_number;      \