chiark / gitweb /
rsa: LDPUBFATAL: Move & before lc into callers
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 23 Nov 2019 17:07:11 +0000 (17:07 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Feb 2020 21:56:50 +0000 (21:56 +0000)
We are going to want to add a new call site that passes 0.

And format it nicely.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
rsa.c

diff --git a/rsa.c b/rsa.c
index 7d5024922c4829e9dd94361fd4d6b0ec81a53ad5..3770aa6571608c01086d71041c6bdf93bb46534e 100644 (file)
--- a/rsa.c
+++ b/rsa.c
@@ -328,7 +328,10 @@ static void rsapub_dispose(void *sst) {
 #define RSAPUB_LOADCORE_DEFBN(ix,en,what) \
     const char *en##s, struct cloc en##_loc,
 
-#define LDPUBFATAL(lc,...) ({load_err(l,&lc,0,0,__VA_ARGS__); goto error_out;})
+#define LDPUBFATAL(lc,...) ({                  \
+       load_err(l,(lc),0,0,__VA_ARGS__);       \
+       goto error_out;                         \
+    })
 
 static struct rsapub *rsa_loadpub_core(RSAPUB_BNS(RSAPUB_LOADCORE_DEFBN)
                                       struct load_ctx *l)
@@ -352,11 +355,11 @@ static struct rsapub *rsa_loadpub_core(RSAPUB_BNS(RSAPUB_LOADCORE_DEFBN)
 
 #define RSAPUB_LOADCORE_GETBN(ix,en,what)                              \
     if (mpz_init_set_str(&st->en,en##s,10)!=0) {                       \
-       LDPUBFATAL(en##_loc, what " \"%s\" is not a "                   \
+       LDPUBFATAL(&en##_loc, what " \"%s\" is not a "                  \
                 "decimal number string\n",en##s);                      \
     }                                                                  \
     if (mpz_sizeinbase(&st->en, 256) > RSA_MAX_MODBYTES) {             \
-       LDPUBFATAL(en##_loc, "implausibly large " what "\n");           \
+       LDPUBFATAL(&en##_loc, "implausibly large " what "\n");          \
     }
 
     RSAPUB_BNS(RSAPUB_LOADCORE_GETBN)