Commit da0f2a1a authored by rswindell's avatar rswindell
Browse files

Make center() less destructive:

Use cursor-right movement rather than spaces for left-margin.
Don't do the clear-to-EOL thing added in previous commit.
parent 77f2c366
......@@ -749,19 +749,17 @@ void sbbs_t::inc_column(int count)
void sbbs_t::center(char *instr, unsigned int columns)
{
char str[256];
int i,j;
size_t len;
if(columns < 1)
columns = cols;
SAFECOPY(str,instr);
truncsp(str);
j=bstrlen(str);
if(j < columns)
for(i=0;i<(columns-j)/2;i++)
outchar(' ');
len = bstrlen(str);
if(len < columns)
cursor_right((columns - len) / 2);
bputs(str);
cleartoeol();
newline();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment