summaryrefslogtreecommitdiff
path: root/mpi
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2013-09-30 13:20:06 +0200
committerWerner Koch <wk@gnupg.org>2013-09-30 20:44:50 +0200
commitd69a13d3d1c14ad6a6aa7cd349d6d2dfb152d422 (patch)
tree5e96dcc38220ca22368d3b4b497f02a2fc9bdba4 /mpi
parent68cefd0f1d60ac33b58031df9b1d165cb1bf0f14 (diff)
downloadlibgcrypt-d69a13d3d1c14ad6a6aa7cd349d6d2dfb152d422.tar.gz
log: Try to print s-expressions in a more compact format.
* src/misc.c (count_closing_parens): New. (_gcry_log_printsxp): Use new function. * mpi/ec.c (_gcry_mpi_point_log): Take care of a NULL point. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'mpi')
-rw-r--r--mpi/ec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mpi/ec.c b/mpi/ec.c
index c6d0fc8c..de681a10 100644
--- a/mpi/ec.c
+++ b/mpi/ec.c
@@ -42,6 +42,12 @@ _gcry_mpi_point_log (const char *name, mpi_point_t point, mpi_ec_t ctx)
gcry_mpi_t x, y;
char buf[100];
+ if (!point)
+ {
+ snprintf (buf, sizeof buf - 1, "%s.*", name);
+ log_mpidump (buf, NULL);
+ return;
+ }
snprintf (buf, sizeof buf - 1, "%s.X", name);
if (ctx)