 
     while (*p != '"') {
       sender[i++] = *p++;
+      if (i >= sizeof(sender)) break;
     }
 
     while (*p != '\n') ++p; ++p;

  if (!gsmSendCommand_P(F("AT"))) {
    return 1;
  }
  
  if (!gsmSendCommand_P(F("AT+IPR=9600"))) {
    return 2;
  }
  
  if (!gsmSendCommand_P(F("AT+CFUN=1"))) {
    return 3;
  }

  return 0;
}

uint8_t gsmSetup(const char* apn) {
  bool success = false;

  for (uint8_t n = 0; n < 30; n++) {


    while (*p != ',') {
      index[i++] = *p++;
      if (i >= sizeof(index)) break;
    }

    while (*p != '"') ++p; ++p;
