Skip to content

Commit 1b835ba

Browse files
committed
Merge pull request #236 from woodyhymns/master
fix bug of getting Gateway value & bug of missing parameter 'level'
2 parents 39d502b + 852c324 commit 1b835ba

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/centralserver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ _connect_auth_server(int level)
319319
free(h_addr);
320320

321321
if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
322-
debug(LOG_ERR, "Level %d: Failed to create a new SOCK_STREAM socket: %s", strerror(errno));
322+
debug(LOG_ERR, "Level %d: Failed to create a new SOCK_STREAM socket: %s", level, strerror(errno));
323323
return (-1);
324324
}
325325

src/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ get_ext_iface(void)
252252
}
253253
while (!feof(input)) {
254254
/* XXX scanf(3) is unsafe, risks overrun */
255-
if ((fscanf(input, "%15s %15s %*s %*s %*s %*s %*s %*s %*s %*s %*s\n", device, gw) == 2)
255+
if ((fscanf(input, "%15s %*s %15s %*s %*s %*s %*s %*s %*s %*s %*s\n", device, gw) == 2)
256256
&& strcmp(gw, "00000000") == 0) {
257257
free(gw);
258258
debug(LOG_INFO, "get_ext_iface(): Detected %s as the default interface after trying %d", device, i);

0 commit comments

Comments
 (0)