libc: small cleanup.

Initialize newsize in the code section so we avoids asigning the
value if we exit early.
This commit is contained in:
Pedro F. Giffuni 2017-03-12 03:50:13 +00:00
parent 901a475b7a
commit 97721eb583
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=315104

View File

@ -641,12 +641,13 @@ __grow_type_table(struct typetable *types)
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) {