diff --git a/src/sbbs3/atcodes.cpp b/src/sbbs3/atcodes.cpp index e11c2e3d3d32a99c429f6d5a9d1dc7cc9a3c6f25..ee5a0cff9f9eefbe080ad1614c78de4c52ed8c5f 100644 --- a/src/sbbs3/atcodes.cpp +++ b/src/sbbs3/atcodes.cpp @@ -144,7 +144,7 @@ int sbbs_t::show_atcode(const char *instr) *p=0; } - cp = atcode(sp, str2, sizeof(str2), &pmode); + cp = atcode(sp, str2, sizeof(str2), &pmode, centered); if(cp==NULL) return(0); @@ -210,7 +210,7 @@ static const char* getpath(scfg_t* cfg, const char* path) return path; } -const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen, long* pmode) +const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen, long* pmode, bool centered) { char* tp = NULL; uint i; @@ -613,7 +613,9 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen, long* pmode) if(strncmp(sp, "FILL:", 5) == 0) { sp += 5; - while(*sp && online && column < cols - 1) + long margin = centered ? column : 1; + if(margin < 1) margin = 1; + while(*sp && online && column < cols - margin) bputs(sp, P_TRUNCATE); return nulstr; } diff --git a/src/sbbs3/sbbs.h b/src/sbbs3/sbbs.h index 9883f1a5744d252c980db41cd13759a86d002b4a..bc3f108a97ff74bfc060e7a1626cb823af968110 100644 --- a/src/sbbs3/sbbs.h +++ b/src/sbbs3/sbbs.h @@ -815,7 +815,7 @@ public: /* atcodes.cpp */ int show_atcode(const char *code); - const char* atcode(char* sp, char* str, size_t maxlen, long* pmode = NULL); + const char* atcode(char* sp, char* str, size_t maxlen, long* pmode = NULL, bool centered = false); /* getnode.cpp */ int getsmsg(int usernumber, bool clearline = false);