(MP_DOFPRINTFR): cope with null pointers.
authormdw <mdw>
Sun, 8 Oct 2000 12:04:58 +0000 (12:04 +0000)
committermdw <mdw>
Sun, 8 Oct 2000 12:04:58 +0000 (12:04 +0000)
mptext.h

index c6e8275..db4e591 100644 (file)
--- 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("<null>", fp);                                               \
   fputc('\n', fp);                                                     \
 } while (0)