summaryrefslogtreecommitdiff
path: root/out_str.c
diff options
context:
space:
mode:
Diffstat (limited to 'out_str.c')
-rw-r--r--out_str.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/out_str.c b/out_str.c
index 35f1dfc..ab56b94 100644
--- a/out_str.c
+++ b/out_str.c
@@ -30,6 +30,9 @@ mpc_out_str (FILE *stream, int base, size_t n, mpc_srcptr op, mpc_rnd_t rnd)
{
size_t size;
+ if (stream == NULL)
+ stream = stdout; /* fprintf does not allow NULL as first argument */
+
size = mpfr_out_str (stream, base, n, MPC_RE(op), MPC_RND_RE(rnd));
size += fprintf (stream, "+I*");
size += mpfr_out_str (stream, base, n, MPC_IM(op), MPC_RND_IM(rnd));