aboutsummaryrefslogtreecommitdiffstats
path: root/g10/progress.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2003-05-26 13:21:12 +0000
committerDavid Shaw <[email protected]>2003-05-26 13:21:12 +0000
commitad9f6ae4b5e5a78d21d129fd249808842f49a226 (patch)
tree43654c3c724c6f686cf622bd31a24ac49db1d0a3 /g10/progress.c
parent* Makefile.am: Make use of AM_CFLAGS. (From wk on stable branch) (diff)
downloadgnupg-ad9f6ae4b5e5a78d21d129fd249808842f49a226.tar.gz
gnupg-ad9f6ae4b5e5a78d21d129fd249808842f49a226.zip
* getkey.c (premerge_public_with_secret): Made "no secret subkey for"
warning a verbose item and translatable. (From wk on stable branch) * sig-check.c (check_key_signature2): Made "no subkey for subkey binding packet" a verbose item instead of a !quiet one. There are too many garbled keys out in the wild. (From wk on stable branch) * filter.h: Remove const from WHAT. (From wk on stable branch) * progress.c (handle_progress): Store a copy of NAME. (progress_filter): Release WHAT, make sure not to print a NULL WHAT. (From wk on stable branch) * openfile.c (open_sigfile): Adjust free for new progress semantics. (From wk on stable branch) * plaintext.c (ask_for_detached_datafile): Don't dealloc pfx->WHAT. (From wk on stable branch) * seckey-cert.c (do_check): Issue the RSA_OR_IDEA status when the cipher algo is IDEA to make it easier to track down the problem. (From twoaday on stable branch)
Diffstat (limited to 'g10/progress.c')
-rw-r--r--g10/progress.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/g10/progress.c b/g10/progress.c
index 36b293ab5..bb414faae 100644
--- a/g10/progress.c
+++ b/g10/progress.c
@@ -45,7 +45,9 @@ progress_filter (void *opaque, int control,
pfx->offset = 0;
pfx->last_time = make_timestamp ();
- sprintf (buffer, "%.20s ? %lu %lu", pfx->what, pfx->offset,
+ sprintf (buffer, "%.20s ? %lu %lu",
+ pfx->what? pfx->what : "?",
+ pfx->offset,
pfx->total);
write_status_text (STATUS_PROGRESS, buffer);
}
@@ -69,7 +71,9 @@ progress_filter (void *opaque, int control,
{
char buffer[50];
- sprintf (buffer, "%.20s ? %lu %lu", pfx->what, pfx->offset,
+ sprintf (buffer, "%.20s ? %lu %lu",
+ pfx->what? pfx->what : "?",
+ pfx->offset,
pfx->total);
write_status_text (STATUS_PROGRESS, buffer);
@@ -77,6 +81,14 @@ progress_filter (void *opaque, int control,
pfx->last_time = timestamp;
}
}
+ else if (control == IOBUFCTRL_FREE)
+ {
+ /* Note, that we must always dealloc resources of a filter
+ within the filter handler and not anywhere else. (We set it
+ to NULL and check all uses just in case.) */
+ m_free (pfx->what);
+ pfx->what = NULL;
+ }
else if (control == IOBUFCTRL_DESC)
*(char**)buf = "progress_filter";
return rc;
@@ -99,7 +111,7 @@ handle_progress (progress_filter_context_t *pfx, IOBUF inp, const char *name)
filesize = opt.set_filesize;
/* register the progress filter */
- pfx->what = name ? name : "stdin";
+ pfx->what = m_strdup (name ? name : "stdin");
pfx->total = filesize;
iobuf_push_filter (inp, progress_filter, pfx);
}