mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-18 10:35:55 +00:00
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
This commit is contained in:
parent
b36b897e51
commit
76f66be6bf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=265860
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user