From a7cff17e9b9140a2dd5e883e5c337b7a5da6abeb Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 18 Apr 2004 16:23:00 +0000 Subject: Improved layout of /version, used strtok_r to prevent buffer whacking git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@648 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 64686448e..4e5b5c0be 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -5056,8 +5056,14 @@ void ConnectUser(userrec *user) void handle_version(char **parameters, int pcnt, userrec *user) { char Revision[] = "$Revision$"; - char *v1 = strtok(Revision," "); - char *v2 = strtok(NULL," "); + + char *s1 = Revision; + char *savept; + char *v1 = strtok_r(s1," ",&savept); + s1 = savept; + char *v2 = strtok_r(s1," ",&savept); + s1 = savept; + WriteServ(user->fd,"351 %s :%s Rev. %s %s :%s (O=%d)",user->nick,VERSION,v2,ServerName,SYSTEM,OPTIMISATION); } -- cgit v1.2.3