1 diff --git a/tools/ck-history.c b/tools/ck-history.c
2 index 606106c..e7659d1 100644
3 --- a/tools/ck-history.c
4 +++ b/tools/ck-history.c
5 @@ -60,6 +60,8 @@ typedef enum {
6 #define DEFAULT_LOG_FILENAME LOCALSTATEDIR "/log/ConsoleKit/history"
7 #define MAX_LINE_LEN 2048
9 +#define IS_STR_SET(x) (x != NULL && x[0] != '\0')
11 static GList *all_events = NULL;
14 @@ -515,21 +517,21 @@ print_last_report_record (GList *list,
18 - "%-8.8s %-12.12s %-16.16s %-16.16s",
20 - utline != NULL ? utline : "",
21 - host != NULL ? host : "",
24 + IS_STR_SET (username) ? username : "NULL",
25 + IS_STR_SET (utline) ? utline : "NULL",
26 + IS_STR_SET (host) ? host : "NULL",
27 + IS_STR_SET (addedtime) ? addedtime : "NULL");
30 - "%-8.8s %12s %-10.10s %-7.7s %-12.12s %-28.28s %-16.16s",
36 - host != NULL ? host : "",
38 + "%s\t%s\t%s\t%s\t%s\t%s\t%s",
39 + IS_STR_SET (username) ? username : "NULL",
40 + IS_STR_SET (session_type) ? session_type : "NULL",
41 + IS_STR_SET (session_id) ? session_id : "NULL",
42 + IS_STR_SET (seat_id) ? seat_id : "NULL",
43 + IS_STR_SET (utline) ? utline : "NULL",
44 + IS_STR_SET (host) ? host : "NULL",
45 + IS_STR_SET (addedtime) ? addedtime : "NULL");
49 @@ -576,9 +578,9 @@ print_last_report_record (GList *list,
52 g_string_append_printf (str,
57 + IS_STR_SET (removedtime) ? removedtime : "NULL",
58 + IS_STR_SET (duration) ? duration : "NULL");
60 g_print ("%s\n", str->str);
61 g_string_free (str, TRUE);