Replace all alloca()s with malloc()

This commit is contained in:
david parsons
2008-03-13 16:49:46 -07:00
parent da2bb58c4f
commit 41c153a48a
3 changed files with 30 additions and 18 deletions
+5 -2
View File
@@ -103,8 +103,11 @@ char **argv;
if ( argc > 1 ) {
char *p, *dot;
source = alloca(strlen(argv[1]) + 6);
dest = alloca(strlen(argv[1]) + 6);
source = malloc(strlen(argv[1]) + 6);
dest = malloc(strlen(argv[1]) + 6);
if ( !(source && dest) )
fail("out of memory allocating name buffers");
strcpy(source, argv[1]);
if (( p = strrchr(source, '/') ))