From 0349a10ba78de2178a22f00871bbd7ab2ef54a79 Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Fri, 8 May 2020 13:10:56 +0200 Subject: [PATCH] debug --- main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index 8c7c99c..6fe48ac 100644 --- a/main.c +++ b/main.c @@ -42,16 +42,16 @@ void getutmp( int pid, char user[], char host_ip[], char host_ipv6[], time_t * t if((utmp->ut_addr_v6[1] && utmp->ut_addr_v6[2] && utmp->ut_addr_v6[3]) == 0) { ipv4 = utmp->ut_addr_v6[0] & 0x00000000000000ff; - sprintf( str, "%x.", ipv4); + sprintf( str, "%d.", ipv4); strcat(host_ip, str); ipv4 = (utmp->ut_addr_v6[0] & 0x000000000000ff00) >> 8; - sprintf( str, "%x.", ipv4); + sprintf( str, "%d.", ipv4); strcat(host_ip, str); ipv4 = (utmp->ut_addr_v6[0] & 0x0000000000ff0000) >> 16; - sprintf( str, "%x.", ipv4); + sprintf( str, "%d.", ipv4); strcat(host_ip, str); ipv4 = (utmp->ut_addr_v6[0] & 0x00000000ff000000) >> 24; - sprintf( str, "%x", ipv4); + sprintf( str, "%d", ipv4); strcat(host_ip, str); }else @@ -226,8 +226,8 @@ int main() char cmd[24]; char cmdline[1000]; char user[24]=""; - char host_ip[42]; - char host_ipv6[42]; + char host_ip[42]=""; + char host_ipv6[42]=""; char str[1024]; char date[60]; time_t now ;