From ff6bd228c7a08e9ae80f011145bde29dca4e22e3 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) --- Bus/Ivy/IvyApplication.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Bus/Ivy/IvyApplication.cxx') diff --git a/Bus/Ivy/IvyApplication.cxx b/Bus/Ivy/IvyApplication.cxx index c4d4ed0..96023c7 100644 --- a/Bus/Ivy/IvyApplication.cxx +++ b/Bus/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