       int iSsidLen = strlen(Line)-strlen(Find);
       // Truncate Ssid if it too long
       int n = iSsidLen < SSID_MAX_LENGTH ? iSsidLen : SSID_MAX_LENGTH;
-      strncpy(_sSsidName, SubStr+strlen(Find), n);
+      strncpy(_sSsidName, SubStr+strlen(Find), n-1);
     }
   }
 

///////////////////////////////
void procSsidMsg( aJsonObject *_pJsonSsid )
{
  aJsonObject *poSsid = aJson.getObjectItem(_pJsonSsid, "ssid");
  if ( poSsid && String(poSsid->valuestring).length() <= SSID_MAX_LENGTH )
  {
    if( strcmp(g_sSsid, poSsid->valuestring) )
    {
      sprintf(g_sSsid, "%s", poSsid->valuestring);
      setSsidName(poSsid->valuestring);
    }
  }
 }

    // Test code
    ///////////////////////////////////////
    
 //   getSerialCommand(); 
   
/*
    g_iCatNumber++;
