summaryrefslogtreecommitdiff
path: root/src/qcommon/q_shared.c
diff options
context:
space:
mode:
authorChristopher Schwarz <lakitu7@gmail.com>2009-10-10 19:18:21 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:16:46 +0000
commit19ec3ab02940f56b4e927ff0e67ebcbab718ceb4 (patch)
treea110ba9ce795b59c0c1571dfadcb8f3efd698cac /src/qcommon/q_shared.c
parenta327db46a2d939633b6836de28251ae7d4dbbec5 (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.c7
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;