From c0618aec6e0b2b6ea3c3b5c1aa207180ec0f83c9 Mon Sep 17 00:00:00 2001 From: Ron Koenderink Date: Thu, 6 Jan 2005 02:09:30 +0000 Subject: [PATCH] (news, fina): Report bad conditionals as syntax error. Closes #775475. --- src/lib/commands/fina.c | 3 ++- src/lib/commands/news.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/commands/fina.c b/src/lib/commands/fina.c index 9ca0383e..0998b92c 100644 --- a/src/lib/commands/fina.c +++ b/src/lib/commands/fina.c @@ -57,13 +57,14 @@ fina(void) pr("Loans are not enabled.\n"); return RET_FAIL; } + if (!snxtitem(&ni, EF_LOAN, "*")) + return RET_SYN; (void)time(&now); pr("\n"); pr(" -= Empire Financial Status Report =- \n"); pr(" "); prdate(); pr("Loan From To Rate Dur Paid Total\n"); - snxtitem(&ni, EF_LOAN, "*"); while (nxtitem(&ni, &loan)) { if (loan.l_status != LS_SIGNED) continue; diff --git a/src/lib/commands/news.c b/src/lib/commands/news.c index 0350a9ab..2dc2bce3 100644 --- a/src/lib/commands/news.c +++ b/src/lib/commands/news.c @@ -65,6 +65,8 @@ news(void) s_char num[128]; s_char *verb; + if (!snxtitem(&nstr, EF_NEWS, "*")) + return RET_SYN; memset(page_has_news, 0, sizeof(page_has_news)); memset(sectors_taken, 0, sizeof(sectors_taken)); (void)head(); @@ -86,7 +88,6 @@ news(void) /* if (then < now - days(3)) then = now - days(3); */ - snxtitem(&nstr, EF_NEWS, "*"); pr("\nThe details of Empire news since %s", ctime(&then)); while (nxtitem(&nstr, (s_char *)&nws)) { if (nws.nws_when < then)