diff options
Diffstat (limited to 'extension/readfile.c')
-rw-r--r-- | extension/readfile.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/extension/readfile.c b/extension/readfile.c index d4b4aef9..fbe25748 100644 --- a/extension/readfile.c +++ b/extension/readfile.c @@ -14,20 +14,20 @@ /* * Copyright (C) 2002, 2003, 2004, 2011, 2012, 2013, 2014 * the Free Software Foundation, Inc. - * + * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. - * + * * GAWK is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * GAWK is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA @@ -82,8 +82,8 @@ read_file_to_buffer(int fd, const struct stat *sbuf) goto done; } - emalloc(text, char *, sbuf->st_size + 2, "do_readfile"); - memset(text, '\0', sbuf->st_size + 2); + emalloc(text, char *, sbuf->st_size + 1, "do_readfile"); + memset(text, '\0', sbuf->st_size + 1); if ((ret = read(fd, text, sbuf->st_size)) != sbuf->st_size) { update_ERRNO_int(errno); |