Fix mkmylofw write_out_padding routine

SVN-Revision: 6758
This commit is contained in:
Florian Fainelli 2007-03-29 22:20:21 +00:00
parent d5bb3765ca
commit 56d10f7c3c
1 changed files with 60 additions and 49 deletions

View File

@ -1,10 +1,22 @@
/*
* Copyright (C) 2006,2007 Gabor Juhos
* $Id$
*
* This program 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 2 of the License, or (at your
* option) any later version.
* Copyright (C) 2006,2007 Gabor Juhos <juhosg@freemail.hu>
*
* This program 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 2
* of the License, or (at your option) any later version.
*
* This program 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.
*
*/
@ -463,11 +475,10 @@ int
write_out_padding(FILE *outfile, size_t len, uint8_t padc, uint32_t *crc)
{
uint8_t buff[512];
size_t buflen;
size_t buflen = sizeof(buff);
memset(buff, padc, buflen);
buflen = sizeof(buff);
while (len > 0) {
if (len < buflen)
buflen = len;