                  sprintf(serial_out, "CI#");
                  i += num_consumed_total;
                }
+               else
+                 i++; // incomplete string
          }
+         else
+           i++;// incomplete string
     }
     else
       i++;

void setup() 
{
  first_start = 0;
  strcpy(firmware_version, "2016.02.20.3s");
  
  current_buffer[0] = 0;


                    sprintf(serial_out, "GU%d %d %d#", ultrasound_index, trig_pin, echo_pin);
                    i += 4;
                  }
                  else
                    i++;// incomplete string
        }
        else
         if (tmp_str[i] == 'T' || tmp_str[i] == 't'){// test connection
