Patchwork [prefix.c] : 4 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

login
register
mail settings
Submitter Kai Tietz
Date Nov. 29, 2012, 6:27 p.m.
Message ID <CAEwic4YMtFqUzTSjw3H9oVP33D09X6MNfeUzUONU2hdJWbLy=Q@mail.gmail.com>
Download mbox | patch
Permalink /patch/202803/
State New
Headers show

Comments

Kai Tietz - Nov. 29, 2012, 6:27 p.m.
Fine.  Tested patch using XNEWVEC/XRESIZEVEC for this.  Ok for apply?

Kai
Ian Taylor - Nov. 29, 2012, 6:32 p.m.
On Thu, Nov 29, 2012 at 10:27 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
> Fine.  Tested patch using XNEWVEC/XRESIZEVEC for this.  Ok for apply?

This is OK with a ChangeLog entry.

Thanks.

Ian

> Index: prefix.c
> ===================================================================
> --- prefix.c    (Revision 193939)
> +++ prefix.c    (Arbeitskopie)
> @@ -157,12 +157,12 @@ lookup_key (char *key)
>      }
>
>    size = 32;
> -  dst = xmalloc (size);
> +  dst = XNEWVEC (char, size);
>
>    res = RegQueryValueExA (reg_key, key, 0, &type, (LPBYTE) dst, &size);
>    if (res == ERROR_MORE_DATA && type == REG_SZ)
>      {
> -      dst = xrealloc (dst, size);
> +      dst = XRESIZEVEC (char, dst, size);
>        res = RegQueryValueExA (reg_key, key, 0, &type, (LPBYTE) dst, &size);
>      }

Patch

Index: prefix.c
===================================================================
--- prefix.c    (Revision 193939)
+++ prefix.c    (Arbeitskopie)
@@ -157,12 +157,12 @@  lookup_key (char *key)
     }

   size = 32;
-  dst = xmalloc (size);
+  dst = XNEWVEC (char, size);

   res = RegQueryValueExA (reg_key, key, 0, &type, (LPBYTE) dst, &size);
   if (res == ERROR_MORE_DATA && type == REG_SZ)
     {
-      dst = xrealloc (dst, size);
+      dst = XRESIZEVEC (char, dst, size);
       res = RegQueryValueExA (reg_key, key, 0, &type, (LPBYTE) dst, &size);
     }