Index: time.cpp
===================================================================
--- time.cpp    (revision 634377)
+++ time.cpp    (working copy)
@@ -67,12 +67,16 @@
 
     // now get the offset
     tokp = std::strtok (0, ":");
+    if (NULL == tokp)
+        return;
     std::sscanf (tokp, "%d", &tmp_era.era_out.offset);
     if (direction == '-')
         tmp_era.era_out.offset *= -1;
     
     // now get the start date
     tokp = std::strtok (0, ":");
+    if (NULL == tokp)
+        return;
     unsigned int tmp_mon, tmp_day;
     std::sscanf (tokp, "%d/%u/%u", &tmp_era.era_out.year[0], 
                  &tmp_mon, &tmp_day);
@@ -83,6 +87,8 @@
 
     // now get the end date (this may be the beginning or end of time
     tokp = std::strtok (0, ":");
+    if (NULL == tokp)
+        return;
     if (std::strcmp (tokp, "-*") == 0) {
         tmp_era.era_out.year[1] = _RWSTD_INT_MIN;
         tmp_era.era_out.month[1] = _RWSTD_CHAR_MIN;

Reply via email to