1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-03-02 21:11:05 +01:00

* exec.c (expand_args): Remove loop left over from earlier implementation.

(exec_write): Missed one tick.
This commit is contained in:
David Shaw 2002-09-10 18:03:40 +00:00
parent be5f6f7150
commit c30d7e8dc7
2 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2002-09-10 David Shaw <dshaw@jabberwocky.com>
* exec.c (expand_args): Remove loop left over from earlier
implementation. (exec_write): Missed one tick.
2002-09-10 Werner Koch <wk@gnupg.org> 2002-09-10 Werner Koch <wk@gnupg.org>
* encode.c (encode_simple): Make sure we don't use an ESK packet * encode.c (encode_simple): Make sure we don't use an ESK packet

View File

@ -262,10 +262,14 @@ static int expand_args(struct exec_info *info,const char *args_in)
if(append) if(append)
{ {
/* FIXME: Why do we need a loop? -wk */ size_t applen=strlen(append);
while(strlen(append)+len>size-1)
if(applen+len>size-1)
{ {
size+=100; if(applen<100)
applen=100;
size+=applen;
info->command=m_realloc(info->command,size); info->command=m_realloc(info->command,size);
} }
@ -471,7 +475,7 @@ int exec_write(struct exec_info **info,const char *program,
(*info)->tochild=fopen((*info)->tempfile_in,binary?"wb":"w"); (*info)->tochild=fopen((*info)->tempfile_in,binary?"wb":"w");
if((*info)->tochild==NULL) if((*info)->tochild==NULL)
{ {
log_error(_("can't create '%s': %s\n"), log_error(_("can't create `%s': %s\n"),
(*info)->tempfile_in,strerror(errno)); (*info)->tempfile_in,strerror(errno));
ret=G10ERR_WRITE_FILE; ret=G10ERR_WRITE_FILE;
goto fail; goto fail;