chiark / gitweb /
use "Out of memory." consistantly (or with "\n")
[elogind.git] / src / shared / logs-show.c
index bbfb74c2bdfd87583486907e0309cb8fe929f3c7..f90f5a1f0d9b0da8fb12f69c41a267173999b36e 100644 (file)
@@ -53,7 +53,7 @@ static int parse_field(const void *data, size_t length, const char *field, char
         memcpy(buf, (const char*) data + fl, nl);
         ((char*)buf)[nl] = 0;
         if (!buf) {
-                log_error("Out of memory");
+                log_error("Out of memory.");
                 return -ENOMEM;
         }
 
@@ -225,9 +225,10 @@ static int output_short(sd_journal *j, unsigned line, unsigned n_columns,
         else if (!utf8_is_printable_n(message, message_len)) {
                 char bytes[FORMAT_BYTES_MAX];
                 printf(": [%s blob data]\n", format_bytes(bytes, sizeof(bytes), message_len));
-        } else if (message_len + n < n_columns)
+        } else if ((flags & OUTPUT_FULL_WIDTH) ||
+                   (message_len + n < n_columns))
                 printf(": %.*s\n", (int) message_len, message);
-        else if (n < n_columns) {
+        else if (n < n_columns && n_columns - n - 2 >= 3) {
                 char *e;
 
                 e = ellipsize_mem(message, message_len, n_columns - n - 2, 90);