aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-09-09 09:55:18 +0000
committerng0 <ng0@n0.is>2019-09-09 09:55:18 +0000
commitc03c7227ba8ac9acc8992c2166a72bea383c09d6 (patch)
tree63d7e420f1d5cea38830a09c591aa851e345c060 /src/util
parenta4543a4105ca6cea2bd558aed8d2e87981d535ea (diff)
downloadgnunet-c03c7227ba8ac9acc8992c2166a72bea383c09d6.tar.gz
gnunet-c03c7227ba8ac9acc8992c2166a72bea383c09d6.zip
plibc removal: sscanf, win32 socket corrections
Diffstat (limited to 'src/util')
-rw-r--r--src/util/os_installation.c2
-rw-r--r--src/util/os_network.c14
2 files changed, 8 insertions, 8 deletions
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
index 656468707..8d9c6e622 100644
--- a/src/util/os_installation.c
+++ b/src/util/os_installation.c
@@ -156,7 +156,7 @@ get_path_from_proc_maps()
156 return NULL; 156 return NULL;
157 while (NULL != fgets(line, sizeof(line), f)) 157 while (NULL != fgets(line, sizeof(line), f))
158 { 158 {
159 if ((1 == SSCANF(line, 159 if ((1 == sscanf(line,
160 "%*x-%*x %*c%*c%*c%*c %*x %*2x:%*2x %*u%*[ ]%1023s", 160 "%*x-%*x %*c%*c%*c%*c %*x %*2x:%*2x %*u%*[ ]%1023s",
161 dir)) && 161 dir)) &&
162 (NULL != (lgu = strstr(dir, current_pd->libname)))) 162 (NULL != (lgu = strstr(dir, current_pd->libname))))
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,