[PATCH 4/6] cli/dump: define GZPRINTF macro and use it in place of gzprintf

Tomi Ollila tomi.ollila at iki.fi
Mon Apr 13 07:12:47 PDT 2020


On Mon, Apr 13 2020, David Bremner wrote:

> This will at least catch errors, and can be replaced with more
> sophisticated error handling where appropriate.
> ---
>  notmuch-client.h |  4 ++++
>  notmuch-dump.c   | 24 ++++++++++++------------
>  2 files changed, 16 insertions(+), 12 deletions(-)
>
> diff --git a/notmuch-client.h b/notmuch-client.h
> index 467e1d84..01f5101a 100644
> --- a/notmuch-client.h
> +++ b/notmuch-client.h
> @@ -497,6 +497,10 @@ print_status_gzbytes (const char *loc,
>  		      gzFile file,
>  		      int bytes);
>  
> +/* the __location__ macro is defined in talloc.h */
> +#define ASSERT_GZBYTES(file, bytes) ((print_status_gzbytes (__location__, file, bytes)) ?  exit (1) : 0)

The 2 spaces before exit (1) I tried to communicate ;) well, perhaps the
__location__ thing broke the flow...

can be amended if no other comments to be seen

Tomi


More information about the notmuch mailing list