1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00

sscanf always calls realloc

This commit is contained in:
Paul Pluzhnikov
2012-01-08 20:13:35 -05:00
committed by Ulrich Drepper
parent f5420cf073
commit 20b38e0301
2 changed files with 7 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991-2006, 2007, 2010, 2011 Free Software Foundation, Inc.
/* Copyright (C) 1991-2007, 2010, 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -274,7 +274,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
CHAR_T *old = wp; \
size_t newsize = (UCHAR_MAX + 1 > 2 * wpmax \
? UCHAR_MAX + 1 : 2 * wpmax); \
if (use_malloc || __libc_use_alloca (newsize)) \
if (use_malloc || !__libc_use_alloca (newsize)) \
{ \
wp = realloc (use_malloc ? wp : NULL, newsize); \
if (wp == NULL) \