Host library for controlling a WiConnect enabled Wi-Fi module.

Dependents:   wiconnect-ota_example wiconnect-web_setup_example wiconnect-test-console wiconnect-tcp_server_example ... more

Files at this revision

API Documentation at this revision

Comitter:
dan_ackme
Date:
Mon Oct 27 13:52:55 2014 -0700
Parent:
30:fe5d89951afb
Child:
32:b2bdbc018665
Commit message:
bug fix

Changed in this revision

NetworkInterface.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/NetworkInterface.cpp	Mon Oct 27 13:44:25 2014 -0700
+++ b/NetworkInterface.cpp	Mon Oct 27 13:52:55 2014 -0700
@@ -363,11 +363,12 @@
     }
     uint32_t ip = 0;
     int i;
-    char *tok;
+    const char *tok;
 
     for(i = 0; i < 4; ++i, str = tok)
     {
         uint8_t nibble;
+        char buf[4];
 
         tok = strchr(str, '.');
         if(tok == NULL)
@@ -376,13 +377,15 @@
             {
                 return false;
             }
+            strcpy(buf, str);
         }
         else
         {
-            *tok++ = 0;
+            strncpy(buf, str, tok - str);
+            ++tok;
         }
 
-        if(!StringUtil::strToUint8(str, &nibble))
+        if(!StringUtil::strToUint8(buf, &nibble))
         {
             return false;
         }