chiark / gitweb /
test: extend calendarspec test a bit
[elogind.git] / src / shared / util.c
index 4cf928f83a3049a443e1cb5bf9404914ed7e2a06..37fd1adfc9a4f03c71f58a3f54286083f2faf953 100644 (file)
@@ -1968,7 +1968,7 @@ char *format_timestamp(char *buf, size_t l, usec_t t) {
 
         sec = (time_t) (t / USEC_PER_SEC);
 
-        if (strftime(buf, l, "%a, %Y-%m-%d %H:%M:%S %Z", localtime_r(&sec, &tm)) <= 0)
+        if (strftime(buf, l, "%a %Y-%m-%d %H:%M:%S %Z", localtime_r(&sec, &tm)) <= 0)
                 return NULL;
 
         return buf;
@@ -3803,7 +3803,7 @@ int fd_columns(int fd) {
 
 unsigned columns(void) {
         const char *e;
-        unsigned c;
+        int c;
 
         if (_likely_(cached_columns > 0))
                 return cached_columns;
@@ -3811,7 +3811,7 @@ unsigned columns(void) {
         c = 0;
         e = getenv("COLUMNS");
         if (e)
-                safe_atou(e, &c);
+                safe_atoi(e, &c);
 
         if (c <= 0)
                 c = fd_columns(STDOUT_FILENO);