]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
posix: do not use time(2) input argument
authorSami Kerola <kerolasa@iki.fi>
Mon, 29 Aug 2016 21:38:05 +0000 (22:38 +0100)
committerSami Kerola <kerolasa@iki.fi>
Tue, 30 Aug 2016 22:24:53 +0000 (23:24 +0100)
Function time(2) argument is obsolescent and should always be NULL in new
code.  When the argument is NULL, the call cannot fail.

Reference: http://man7.org/linux/man-pages/man2/time.2.html

curses.c

index 74e6076c03701fc7bce51ed2ce5454fbc260a31a..34fdafbc0745c9b1fc6a48d953090fa28eb67171 100644 (file)
--- a/curses.c
+++ b/curses.c
@@ -655,7 +655,7 @@ extern void mtr_curses_redraw(struct mtr_ctl *ctl)
     printw("bitpattern=rand(0x00-FF))");
   }
   */
-  time(&t);
+  t = time(NULL);
   mvprintw(1, maxx-25, iso_time(&t));
   printw("\n");