From: mdw Date: Sun, 8 Oct 2000 12:04:58 +0000 (+0000) Subject: (MP_DOFPRINTFR): cope with null pointers. X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/commitdiff_plain/7383bc11a43ad9cc6bb0229ad3f2686fc999e8a4 (MP_DOFPRINTFR): cope with null pointers. --- diff --git a/mptext.h b/mptext.h index c6e8275..db4e591 100644 --- a/mptext.h +++ b/mptext.h @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: mptext.h,v 1.4 2000/06/17 11:46:58 mdw Exp $ + * $Id: mptext.h,v 1.5 2000/10/08 12:04:58 mdw Exp $ * * Textual representation of multiprecision numbers * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: mptext.h,v $ + * Revision 1.5 2000/10/08 12:04:58 mdw + * (MP_DOFPRINTFR): cope with null pointers. + * * Revision 1.4 2000/06/17 11:46:58 mdw * Convenience macros for producing debugging output containing MP * integers. @@ -122,7 +125,10 @@ extern int mp_writefile(mp */*m*/, FILE */*fp*/, int /*radix*/); #define MP_DOFPRINTFR(fp, args, m, r) do { \ fprintf args; \ - mp_writefile(m, fp, r); \ + if (m) \ + mp_writefile(m, fp, r); \ + else \ + fputs("", fp); \ fputc('\n', fp); \ } while (0)