diff options
author | ng0 <ng0@n0.is> | 2019-09-09 09:55:18 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-09-09 09:55:18 +0000 |
commit | c03c7227ba8ac9acc8992c2166a72bea383c09d6 (patch) | |
tree | 63d7e420f1d5cea38830a09c591aa851e345c060 /src/util/os_network.c | |
parent | a4543a4105ca6cea2bd558aed8d2e87981d535ea (diff) | |
download | gnunet-c03c7227ba8ac9acc8992c2166a72bea383c09d6.tar.gz gnunet-c03c7227ba8ac9acc8992c2166a72bea383c09d6.zip |
plibc removal: sscanf, win32 socket corrections
Diffstat (limited to 'src/util/os_network.c')
-rw-r--r-- | src/util/os_network.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/util/os_network.c b/src/util/os_network.c index 6bf9d1846..4df37b9e5 100644 --- a/src/util/os_network.c +++ b/src/util/os_network.c | |||
@@ -109,7 +109,7 @@ try_ifconfig(GNUNET_OS_NetworkInterfaceProcessor proc, | |||
109 | } | 109 | } |
110 | if (!isspace(line[0])) | 110 | if (!isspace(line[0])) |
111 | { | 111 | { |
112 | have_ifc = (1 == SSCANF(line, "%11s", ifc)) ? GNUNET_YES : GNUNET_NO; | 112 | have_ifc = (1 == sscanf(line, "%11s", ifc)) ? GNUNET_YES : GNUNET_NO; |
113 | /* would end with ':' on OSX, fix it! */ | 113 | /* would end with ':' on OSX, fix it! */ |
114 | if (ifc[strlen(ifc) - 1] == ':') | 114 | if (ifc[strlen(ifc) - 1] == ':') |
115 | ifc[strlen(ifc) - 1] = '\0'; | 115 | ifc[strlen(ifc) - 1] = '\0'; |
@@ -137,12 +137,12 @@ try_ifconfig(GNUNET_OS_NetworkInterfaceProcessor proc, | |||
137 | prefixlen = 0; | 137 | prefixlen = 0; |
138 | 138 | ||
139 | if ( /* Linux */ | 139 | if ( /* Linux */ |
140 | (3 == SSCANF(start, "inet addr:%127s Bcast:%127s Mask:%127s", addrstr, bcstr, netmaskstr)) || | 140 | (3 == sscanf(start, "inet addr:%127s Bcast:%127s Mask:%127s", addrstr, bcstr, netmaskstr)) || |
141 | (2 == SSCANF(start, "inet addr:%127s Mask:%127s", addrstr, netmaskstr)) || | 141 | (2 == sscanf(start, "inet addr:%127s Mask:%127s", addrstr, netmaskstr)) || |
142 | (2 == SSCANF(start, "inet6 addr:%127s %d", addrstr, &prefixlen)) || | 142 | (2 == sscanf(start, "inet6 addr:%127s %d", addrstr, &prefixlen)) || |
143 | /* Solaris, OS X */ | 143 | /* Solaris, OS X */ |
144 | (1 == SSCANF(start, "inet %127s", addrstr)) || | 144 | (1 == sscanf(start, "inet %127s", addrstr)) || |
145 | (1 == SSCANF(start, "inet6 %127s", addrstr))) | 145 | (1 == sscanf(start, "inet6 %127s", addrstr))) |
146 | { | 146 | { |
147 | /* IPv4 */ | 147 | /* IPv4 */ |
148 | if (1 == inet_pton(AF_INET, addrstr, &v4)) | 148 | if (1 == inet_pton(AF_INET, addrstr, &v4)) |
@@ -294,7 +294,7 @@ try_ip(GNUNET_OS_NetworkInterfaceProcessor proc, | |||
294 | memset(ifname, 0, 64); | 294 | memset(ifname, 0, 64); |
295 | memset(afstr, 0, 6); | 295 | memset(afstr, 0, 6); |
296 | memset(addrstr, 0, 128); | 296 | memset(addrstr, 0, 128); |
297 | if (4 != SSCANF(line, | 297 | if (4 != sscanf(line, |
298 | "%*u: %63s %5s %127s %6u", | 298 | "%*u: %63s %5s %127s %6u", |
299 | ifname, | 299 | ifname, |
300 | afstr, | 300 | afstr, |