summaryrefslogtreecommitdiff
path: root/Ivy/IvyApplication.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Ivy/IvyApplication.cxx')
-rw-r--r--Ivy/IvyApplication.cxx12
1 files changed, 11 insertions, 1 deletions
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);