huaweimodem: Fix DHCP parsing on 32-bit platforms

strtol clamps returned value between INT_MIN and INT_MAX, causing
invalid value (255.255.255.127) being reported for any address
if last octet > 127 when sizeof(long) == 4.
This commit is contained in:
Santtu Lakkala 2016-08-10 13:04:07 +03:00 committed by Denis Kenzior
parent 27f9da901f
commit 54c9068ff2
1 changed files with 1 additions and 1 deletions

View File

@ -80,7 +80,7 @@ static gboolean get_next_addr(GAtResultIter *iter, char **addr)
if (g_at_result_iter_next_unquoted_string(iter, &str) == FALSE)
return FALSE;
val = strtol(str, NULL, 16);
val = strtoul(str, NULL, 16);
if (addr)
*addr = g_strdup_printf("%u.%u.%u.%u",