Mercurial > hg > octave-kai > gnulib-hg
diff lib/findprog.c @ 7603:23f14c284219
Simplify xmalloc expressions. Add overflow check in xmalloc arguments.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Mon, 06 Nov 2006 13:03:10 +0000 |
parents | 4a8b5467d8b2 |
children | 1e16373508e1 |
line wrap: on
line diff
--- a/lib/findprog.c +++ b/lib/findprog.c @@ -92,7 +92,7 @@ /* Add the "./" prefix for real, that concatenated_pathname() optimized away. This avoids a second PATH search when the caller uses execlp/execvp. */ - progpathname = (char *) xmalloc (2 + strlen (progname) + 1); + progpathname = XNMALLOC (2 + strlen (progname) + 1, char); progpathname[0] = '.'; progpathname[1] = '/'; memcpy (progpathname + 2, progname, strlen (progname) + 1);