From 67abfec93d33a97a97433e01d9efa78ab430ea45 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 12:59:59 +0000 Subject: Utilisateur : Fcolin Date : 14/11/02 Heure : 15:45 Archivé dans $/Bus/Ivy Commentaire: (vss 16) --- Ivy/IvyApplication.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Ivy/IvyApplication.cxx') diff --git a/Ivy/IvyApplication.cxx b/Ivy/IvyApplication.cxx index c4d4ed0..96023c7 100644 --- a/Ivy/IvyApplication.cxx +++ b/Ivy/IvyApplication.cxx @@ -11,6 +11,16 @@ #define ARG_START "\002" #define ARG_END "\003" +static char * firstArg( char *s, const char *separator ) +{ + char *ptr = s; + + while ( *ptr && *ptr != *separator ) + ptr++; + if ( *ptr == *separator ) + return ptr++ ; + else return NULL; +} /* function like strok but do not eat consecutive separator */ @@ -97,7 +107,7 @@ void IvyApplication::OnReceive(char * line) #endif //IVY_DEBUG err = sscanf( line ,"%d %d", &kind_of_msg, &id); - arg = strstr( line , ARG_START ); + arg = firstArg( line , ARG_START ); if ( (err != 2) || (arg == NULL) ) { TRACE("Quitting bad format %s\n", line); -- cgit v1.1