From owner-svn-src-head@freebsd.org Sun Mar 12 03:50:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0B7DD08746; Sun, 12 Mar 2017 03:50:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 C07F6177D; Sun, 12 Mar 2017 03:50:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2C3oDmF025208; Sun, 12 Mar 2017 03:50:13 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2C3oDwP025207; Sun, 12 Mar 2017 03:50:13 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201703120350.v2C3oDwP025207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 12 Mar 2017 03:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315104 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Mar 2017 03:50:15 -0000 Author: pfg Date: Sun Mar 12 03:50:13 2017 New Revision: 315104 URL: https://svnweb.freebsd.org/changeset/base/315104 Log: libc: small cleanup. Initialize newsize in the code section so we avoids asigning the value if we exit early. Modified: head/lib/libc/stdio/printf-pos.c Modified: head/lib/libc/stdio/printf-pos.c ============================================================================== --- head/lib/libc/stdio/printf-pos.c Sun Mar 12 03:49:05 2017 (r315103) +++ head/lib/libc/stdio/printf-pos.c Sun Mar 12 03:50:13 2017 (r315104) @@ -641,12 +641,13 @@ __grow_type_table(struct typetable *type enum typeid *const oldtable = types->table; const int oldsize = types->tablesize; enum typeid *newtable; - u_int n, newsize = oldsize * 2; + u_int n, newsize; /* Detect overflow */ if (types->nextarg > NL_ARGMAX) return (-1); + newsize = oldsize * 2; if (newsize < types->nextarg + 1) newsize = types->nextarg + 1; if (oldsize == STATIC_ARG_TBL_SIZE) {