diff options
author | Christopher Schwarz <lakitu7@gmail.com> | 2009-10-10 19:18:21 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:16:46 +0000 |
commit | 19ec3ab02940f56b4e927ff0e67ebcbab718ceb4 (patch) | |
tree | a110ba9ce795b59c0c1571dfadcb8f3efd698cac /src/qcommon/q_shared.c | |
parent | a327db46a2d939633b6836de28251ae7d4dbbec5 (diff) |
* (bug 3998) linewrap cp, parse newlines in cp and motd
Diffstat (limited to 'src/qcommon/q_shared.c')
-rw-r--r-- | src/qcommon/q_shared.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qcommon/q_shared.c b/src/qcommon/q_shared.c index 5b74badd..6da13ad0 100644 --- a/src/qcommon/q_shared.c +++ b/src/qcommon/q_shared.c @@ -935,6 +935,13 @@ int Q_CountChar(const char *string, char tocount) return count; } +void Q_ParseNewlines( char *dest, const char *src, int destsize ) +{ + for( ; *src && destsize > 1; src++, destsize-- ) + *dest++ = ( ( *src == '\\' && *( ++src ) == 'n' ) ? '\n' : *src ); + *dest++ = '\0'; +} + void QDECL Com_sprintf( char *dest, int size, const char *fmt, ...) { int len; va_list argptr; |