summaryrefslogtreecommitdiff
path: root/Bus/Ivy/IvyApplication.cxx
diff options
context:
space:
mode:
authorfcolin2007-02-01 12:59:59 +0000
committerfcolin2007-02-01 12:59:59 +0000
commitff6bd228c7a08e9ae80f011145bde29dca4e22e3 (patch)
tree175a3942455a6bed8795f5bbea6914a512edf8d8 /Bus/Ivy/IvyApplication.cxx
parent2bfacfd67c1033cbca6652f6fca8a6fde22c3b24 (diff)
downloadivy-cplusplus-ff6bd228c7a08e9ae80f011145bde29dca4e22e3.zip
ivy-cplusplus-ff6bd228c7a08e9ae80f011145bde29dca4e22e3.tar.gz
ivy-cplusplus-ff6bd228c7a08e9ae80f011145bde29dca4e22e3.tar.bz2
ivy-cplusplus-ff6bd228c7a08e9ae80f011145bde29dca4e22e3.tar.xz
Utilisateur : Fcolin Date : 14/11/02 Heure : 15:45 Archivé dans $/Bus/Ivy Commentaire: (vss 16)
Diffstat (limited to 'Bus/Ivy/IvyApplication.cxx')
-rw-r--r--Bus/Ivy/IvyApplication.cxx12
1 files changed, 11 insertions, 1 deletions
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);