13 Feb, 2019, Rhien wrote in the 1st comment:
Votes: 0
Code base is ROM. My question is in regards *fread_string and new lines. There is a fix_string function called on some things like the room descriptions and player descriptions when they're saved that strips out tilde's and '\r'. It looks like the code in fread_string then takes a '\n' when it finds it and then puts a '\r' behind it to make a "\n\r". Shouldn't this instead be "\r\n"?

To test fix this I modified the code as below (old code and new code displayed). It appears to return "\r\n" and doesn't bork clients that don't handle malformed carriage return/line feeds.

My question from a code review standpoint is does anyone see any issue's with this change?

Old Code:

case '\n':
plast++;
*plast++ = '\r';
break;
case '\r':
break;


New Code:

case '\n':
*plast = '\r';
plast++;
*plast++ = '\n';
break;
case '\r':
break;


Side note, not sure why the "1." was placed in the code tag. Ignore that.
0.0/1