From owner-svn-src-all@FreeBSD.ORG Sat May 10 22:27:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6622635; Sat, 10 May 2014 22:27:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93D27B5; Sat, 10 May 2014 22:27:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AMR2ZV079060; Sat, 10 May 2014 22:27:02 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AMR2Is079059; Sat, 10 May 2014 22:27:02 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405102227.s4AMR2Is079059@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 10 May 2014 22:27:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265860 - head/usr.bin/printf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 22:27:02 -0000 Author: pfg Date: Sat May 10 22:27:01 2014 New Revision: 265860 URL: http://svnweb.freebsd.org/changeset/base/265860 Log: 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 Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Sat May 10 21:53:07 2014 (r265859) +++ head/usr.bin/printf/printf.c Sat May 10 22:27:01 2014 (r265860) @@ -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;