From 76f66be6bfc79104e9f4d0c9ee3ea0c9823ae17a Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Sat, 10 May 2014 22:27:01 +0000 Subject: [PATCH] prinf: replace use of alloca with variable length array. Use of alloca(3) is discouraged in FreeBSD. Using a VLA is simple and should be more portable. Requested by: jilles --- usr.bin/printf/printf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c index ac122f78c1d9..055657fe057a 100644 --- a/usr.bin/printf/printf.c +++ b/usr.bin/printf/printf.c @@ -215,13 +215,11 @@ printf_doformat(char *fmt, int *rval) static const char skip1[] = "#'-+ 0"; int fieldwidth, haveprec, havewidth, mod_ldbl, precision; char convch, nextch; - char *start; + char start[strlen(fmt) + 1]; char **fargv; char *dptr; int l; - start = alloca(strlen(fmt) + 1); - dptr = start; *dptr++ = '%'; *dptr = 0;