]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libiberty/getpwd.c
libiberty.h (ACONCAT): Properly cast value of alloca().
[thirdparty/gcc.git] / libiberty / getpwd.c
index c7880d70444494763b89d429b3b3bd34d91f2978..fa5c132fd6b6e48c11efe723dfc492635ddc1522 100644 (file)
@@ -84,7 +84,7 @@ getpwd (void)
             && dotstat.st_dev == pwdstat.st_dev))
 
        /* The shortcut didn't work.  Try the slow, ``sure'' way.  */
-       for (s = GUESSPATHLEN;  ! getcwd (p = xmalloc (s), s);  s *= 2)
+       for (s = GUESSPATHLEN;  !getcwd (p = XNEWVEC (char, s), s);  s *= 2)
          {
            int e = errno;
            free (p);
@@ -117,7 +117,7 @@ getpwd (void)
   static char *pwd = 0;
 
   if (!pwd)
-    pwd = getcwd (xmalloc (MAXPATHLEN + 1), MAXPATHLEN + 1
+    pwd = getcwd (XNEWVEC (char, MAXPATHLEN + 1), MAXPATHLEN + 1
 #ifdef VMS
                  , 0
 #endif