+ if(ipLen && ipLen < sizeof(outAddress->IP.ipAddress))
+ {
+ strncpy(outAddress->IP.ipAddress, pAddress, ipLen);
+ outAddress->IP.ipAddress[ipLen] = '\0';
+ }
+ else if (!ipLen && len < sizeof(outAddress->IP.ipAddress))
+ {
+ strncpy(outAddress->IP.ipAddress, pAddress, len);
+ outAddress->IP.ipAddress[len] = '\0';
+ }
+ else
+ {
+ OIC_LOG_V(ERROR, TAG, "IP Address too long: %d", ipLen==0 ? len : ipLen);
+ return -1;
+ }
+