Skip to content

Commit a33a3d4

Browse files
committed
Credits: fix missing caret return if the file misses newline at EOL
The bug was caused by migrating to Q_strncpy (strlcpy), which always inserts zero terminator at the end of the buffer. But the ugly parser below this code expects a caret return.
1 parent a5bfb84 commit a33a3d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

menus/Credits.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ void CMenuCredits::_Init( void )
168168
memcpy( tmp, buffer, count );
169169
EngFuncs::COM_FreeFile( buffer );
170170
buffer = tmp;
171-
Q_strncpy( buffer + count, "\r", 1 ); // add terminator
171+
Q_strncpy( buffer + count, "\r", 2 ); // add terminator
172172
count += 2; // added "\r\0"
173173
}
174174
p = buffer;

0 commit comments

Comments
 (0)