mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-28 04:55:08 +00:00
better fix the gcc warning
This commit is contained in:
parent
a13c56a7a5
commit
a7513c76e5
@ -37,6 +37,7 @@
|
||||
#include <unistd.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/time.h>
|
||||
#include <cinttypes>
|
||||
|
||||
struct read_tcpip_data {
|
||||
char *host;
|
||||
@ -75,7 +76,7 @@ void parse_tcp_ping_arg(struct text_object *obj, const char *arg, void *free_at_
|
||||
obj->data.opaque = addr;
|
||||
memset(addr, 0, sizeof(struct sockaddr_in));
|
||||
hostname = (char *) malloc(strlen(arg)+1);
|
||||
switch( sscanf(arg, "%s %u", hostname, (unsigned int*) &(addr->sin_port)) ) {
|
||||
switch( sscanf(arg, "%s %"SCNu16, hostname, &(addr->sin_port)) ) {
|
||||
case 1:
|
||||
addr->sin_port = DEFAULT_TCP_PING_PORT;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user