From bef6a52eb6f5d4c571673acab3d6140fdb3be979 Mon Sep 17 00:00:00 2001 From: chuan Date: Tue, 10 Mar 2026 19:49:21 +0800 Subject: [PATCH 1/2] add GMT error --- src/gmt_support.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gmt_support.c b/src/gmt_support.c index 997f84a271a..f6fb4d9a3e4 100644 --- a/src/gmt_support.c +++ b/src/gmt_support.c @@ -17352,6 +17352,11 @@ struct GMT_REFPOINT * gmt_get_refpoint (struct GMT_CTRL *GMT, char *arg_in, char } } justify = gmt_just_decode (GMT, txt_x, PSL_MC); + if (justify == -99) { + GMT_Report (GMT->parent, GMT_MSG_ERROR, "Option -%c: Invalid justification code %s after %c\n", option, txt_x, arg[0]); + gmt_M_str_free (arg); + return NULL; + } } else { /* Must worry about leading + signs in the numbers that might confuse us w.r.t. modifiers */ /* E.g., -Dg123.3/+19+jTL we don't want to trip up on +19 as modifier! */ From f28a35f4dbdf4113c932d595e03d02c4192e98fe Mon Sep 17 00:00:00 2001 From: chuan Date: Tue, 10 Mar 2026 22:16:24 +0800 Subject: [PATCH 2/2] use PSL_BAD_VALUE instead of -99 --- src/gmt_support.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gmt_support.c b/src/gmt_support.c index f6fb4d9a3e4..326f0201c69 100644 --- a/src/gmt_support.c +++ b/src/gmt_support.c @@ -17352,7 +17352,7 @@ struct GMT_REFPOINT * gmt_get_refpoint (struct GMT_CTRL *GMT, char *arg_in, char } } justify = gmt_just_decode (GMT, txt_x, PSL_MC); - if (justify == -99) { + if (justify == PSL_BAD_VALUE) { GMT_Report (GMT->parent, GMT_MSG_ERROR, "Option -%c: Invalid justification code %s after %c\n", option, txt_x, arg[0]); gmt_M_str_free (arg); return NULL;