Updated version to 0.2.1.
[tclrobot.git] / hswitch.c
index c55e66d..15ddbc6 100644 (file)
--- a/hswitch.c
+++ b/hswitch.c
@@ -1,5 +1,5 @@
 /*
- * $Id: hswitch.c,v 1.4 2001/11/07 11:50:07 adam Exp $
+ * $Id: hswitch.c,v 1.5 2001/11/08 10:23:02 adam Exp $
  */
 #include <assert.h>
 #include <string.h>
@@ -17,7 +17,7 @@
 static int skipSpace (const char *cp)
 {
     int i = 0;
-    while (strchr (SPACECHR, cp[i]))
+    while (cp[i] && strchr (SPACECHR, cp[i]))
         i++;
     return i;
 }