Skip to content
Snippets Groups Projects
Commit fccf1a57 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Better parsing of invalid @-codes

@-codes never start with a number (decimal digit)
@-codes never contain any whitespace (including tabs, CR and LF).

These 2 issues caused the stock batch file transfer menu for RIP terminals
to display all messed-up.

This RIP menu (text/menu/batchxfr.rip) contains @s and they triggered some
stripping of text and expanding to a text.dat string (!).
parent 861f4073
Branches
Tags
No related merge requests found
Pipeline #8843 passed
......@@ -126,12 +126,13 @@ int sbbs_t::show_atcode(const char *instr, JSObject* obj)
tp = strchr(str + 1, '@');
if (!tp) /* no terminating @ */
return 0;
sp = strchr(str + 1, ' ');
if (sp && sp < tp) /* space before terminating @ */
return 0;
len = (tp - str) + 1;
(*tp) = 0;
sp = (str + 1);
if (IS_DIGIT(*sp)) // @-codes cannot start with a number
return 0;
if (strcspn(sp, " \t\r\n") != strlen(sp)) // white-space before terminating @
return 0;
if (*sp == '~' && *(sp + 1)) { // Mouse hot-spot (hungry)
sp++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment