chiark / gitweb /
coredumpctl: fix columns sizing for timestamp
authorLennart Poettering <lennart@poettering.net>
Thu, 19 Jun 2014 15:29:39 +0000 (17:29 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 19 Jun 2014 15:29:39 +0000 (17:29 +0200)
src/journal/coredumpctl.c
src/shared/time-util.h

index 731468330909589842de9c29db0c260823972bf7..325f62f3e74bb879a271c6d4a82391d0dd65a7a4 100644 (file)
@@ -383,15 +383,15 @@ static int print_list(FILE* file, sd_journal *j, int had_legend) {
 
         if (!had_legend && !arg_no_legend)
                 fprintf(file, "%-*s %*s %*s %*s %*s %s\n",
-                        FORMAT_TIMESTAMP_MAX-1, "TIME",
+                        FORMAT_TIMESTAMP_WIDTH, "TIME",
                         6, "PID",
                         5, "UID",
                         5, "GID",
                         3, "SIG",
                            "EXE");
 
-        fprintf(file, "%*s %*s %*s %*s %*s %s\n",
-                FORMAT_TIMESTAMP_MAX-1, buf,
+        fprintf(file, "%-*s %*s %*s %*s %*s %s\n",
+                FORMAT_TIMESTAMP_WIDTH, buf,
                 6, strna(pid),
                 5, strna(uid),
                 5, strna(gid),
index f68c09560562b6664f906a50409a102777202a5f..34ba6c11be3d284eda7576ad35dcb49f7de6207a 100644 (file)
@@ -58,6 +58,7 @@ typedef struct dual_timestamp {
 #define NSEC_PER_YEAR ((usec_t) (31557600ULL*NSEC_PER_SEC))
 
 #define FORMAT_TIMESTAMP_MAX ((4*4+1)+11+9+4+1) /* weekdays can be unicode */
+#define FORMAT_TIMESTAMP_WIDTH 28 /* when outputting, assume this width */
 #define FORMAT_TIMESTAMP_RELATIVE_MAX 256
 #define FORMAT_TIMESPAN_MAX 64