mirror of
https://github.com/Orc/discount.git
synced 2026-09-25 04:10:00 +03:00
Replace all alloca()s with malloc()
This commit is contained in:
+5
-2
@@ -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, '/') ))
|
||||
|
||||
Reference in New Issue
Block a user