Fix some compiler warnings emitted by gcc-4.8.0
[oweals/busybox.git] / miscutils / last_fancy.c
index b4ae5740c8de8f0856e0848bac0cc9e0e593299a..f687d7e16c7c201c4f784624810c2b95c814e67b 100644 (file)
@@ -4,11 +4,10 @@
  *
  * Copyright (C) 2008 by Patricia Muscalu <patricia.muscalu@axis.com>
  *
- * Licensed under the GPLv2 or later, see the file LICENSE in this tarball.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
 #include "libbb.h"
-#include <utmp.h>
 
 /* NB: ut_name and ut_user are the same field, use only one name (ut_user)
  * to reduce confusion */
@@ -52,7 +51,7 @@ static void show_entry(struct utmp *ut, int state, time_t dur_secs)
 
        /* manpages say ut_tv.tv_sec *is* time_t,
         * but some systems have it wrong */
-        tmp = ut->ut_tv.tv_sec;
+       tmp = ut->ut_tv.tv_sec;
        safe_strncpy(login_time, ctime(&tmp), 17);
        snprintf(logout_time, 8, "- %s", ctime(&dur_secs) + 11);
 
@@ -94,14 +93,14 @@ static void show_entry(struct utmp *ut, int state, time_t dur_secs)
        }
 
        printf(HEADER_FORMAT,
-                  ut->ut_user,
-                  ut->ut_line,
-                  show_wide ? INET6_ADDRSTRLEN : INET_ADDRSTRLEN,
-                  show_wide ? INET6_ADDRSTRLEN : INET_ADDRSTRLEN,
-                  ut->ut_host,
-                  login_time,
-                  logout_str,
-                  duration_str);
+               ut->ut_user,
+               ut->ut_line,
+               show_wide ? INET6_ADDRSTRLEN : INET_ADDRSTRLEN,
+               show_wide ? INET6_ADDRSTRLEN : INET_ADDRSTRLEN,
+               ut->ut_host,
+               login_time,
+               logout_str,
+               duration_str);
 }
 
 static int get_ut_type(struct utmp *ut)
@@ -162,11 +161,10 @@ int last_main(int argc UNUSED_PARAM, char **argv)
        time_t boot_time;
        time_t down_time;
        int file;
-       unsigned opt;
        smallint going_down;
        smallint boot_down;
 
-       opt = getopt32(argv, "Wf:" /* "H" */, &filename);
+       /*opt =*/ getopt32(argv, "Wf:" /* "H" */, &filename);
 #ifdef BUT_UTIL_LINUX_LAST_HAS_NO_SUCH_OPT
        if (opt & LAST_OPT_H) {
                /* Print header line */