Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
---
src/detstats.c | 4 ++--
src/fltedit.c | 2 +-
src/hostmon.c | 2 +-
src/ifstats.c | 4 ++--
src/itrafmon.c | 5 ++---
src/log.c | 4 ++--
src/othptab.c | 2 +-
src/packet.c | 2 +-
src/pktsize.c | 2 +-
src/rvnamed.c | 5 ++---
src/serv.c | 2 +-
src/tui/menurt.c | 4 ++--
12 files changed, 18 insertions(+), 20 deletions(-)
diff --git a/src/detstats.c b/src/detstats.c
index 6b13898..015621c 100644
--- a/src/detstats.c
+++ b/src/detstats.c
@@ -483,7 +483,7 @@ void detstats(char *iface, const struct OPTIONS *options, time_t facilitytime,
peakactivity, peakpps, peakactivity_in,
peakpps_in, peakactivity_out, peakpps_out,
&ifcounts,
- time((time_t *) NULL) - statbegin,
+ time(NULL) - statbegin,
logfile);
startlog = now;
@@ -619,7 +619,7 @@ err:
writedstatlog(iface, options->actmode,
peakactivity, peakpps, peakactivity_in,
peakpps_in, peakactivity_out, peakpps_out,
- &ifcounts, time((time_t *) NULL) - statbegin,
+ &ifcounts, time(NULL) - statbegin,
logfile);
writelog(logging, logfile,
"******** Detailed interface statistics stopped ********");
diff --git a/src/fltedit.c b/src/fltedit.c
index c602e69..aed3936 100644
--- a/src/fltedit.c
+++ b/src/fltedit.c
@@ -514,7 +514,7 @@ void definefilter(int *aborted)
clear_flt_tag();
return;
}
- genname(time((time_t *) NULL), fntemp);
+ genname(time(NULL), fntemp);
pfd =
open(get_path(T_WORKDIR, fntemp), O_CREAT | O_WRONLY | O_TRUNC,
diff --git a/src/hostmon.c b/src/hostmon.c
index 87b0b46..186617b 100644
--- a/src/hostmon.c
+++ b/src/hostmon.c
@@ -1069,7 +1069,7 @@ err:
if (logging) {
signal(SIGUSR1, SIG_DFL);
writeethlog(table.head, options->actmode,
- time((time_t *) NULL) - statbegin, logfile);
+ time(NULL) - statbegin, logfile);
writelog(logging, logfile,
"******** LAN traffic monitor stopped ********");
fclose(logfile);
diff --git a/src/ifstats.c b/src/ifstats.c
index 0746a13..fe3cadd 100644
--- a/src/ifstats.c
+++ b/src/ifstats.c
@@ -541,7 +541,7 @@ void ifstats(const struct OPTIONS *options, struct filterstate *ofilter,
}
if (((now - startlog) >= options->logspan) && (logging)) {
writegstatlog(&table, options->actmode,
- time((time_t *) NULL) - statbegin,
+ time(NULL) - statbegin,
logfile);
startlog = now;
}
@@ -650,7 +650,7 @@ err:
if (logging) {
signal(SIGUSR1, SIG_DFL);
writegstatlog(&table, options->actmode,
- time((time_t *) NULL) - statbegin, logfile);
+ time(NULL) - statbegin, logfile);
writelog(logging, logfile,
"******** General interface statistics stopped ********");
fclose(logfile);
diff --git a/src/itrafmon.c b/src/itrafmon.c
index 34c9fb8..e26f6b9 100644
--- a/src/itrafmon.c
+++ b/src/itrafmon.c
@@ -192,7 +192,7 @@ static void scrolllowerwin(struct othptable *table, int direction)
table->htstat = NOHTIND;
}
printothpentry(table, table->lastvisible,
- table->oimaxy - 1, 0, (FILE *) NULL);
+ table->oimaxy - 1, 0, NULL);
}
} else {
if (table->firstvisible != table->head) {
@@ -205,8 +205,7 @@ static void scrolllowerwin(struct othptable *table, int direction)
whline(table->borderwin, ACS_HLINE, 8);
table->htstat = NOHTIND;
}
- printothpentry(table, table->firstvisible, 0, 0,
- (FILE *) NULL);
+ printothpentry(table, table->firstvisible, 0, 0, NULL);
}
}
}
diff --git a/src/log.c b/src/log.c
index d2b8b03..2a3d12d 100644
--- a/src/log.c
+++ b/src/log.c
@@ -104,7 +104,7 @@ void writelog(int logging, FILE * fd, char *msg)
char atime[TIME_TARGET_MAX];
if (logging) {
- genatime(time((time_t *) NULL), atime);
+ genatime(time(NULL), atime);
fprintf(fd, "%s; %s\n", atime, msg);
}
@@ -116,7 +116,7 @@ void write_daemon_err(char *msg, va_list vararg)
char atime[TIME_TARGET_MAX];
FILE *fd;
- genatime(time((time_t *) NULL), atime);
+ genatime(time(NULL), atime);
fd = fopen(DAEMONLOG, "a");
fprintf(fd, "%s iptraf[%u]: ", atime, getpid());
vfprintf(fd, msg, vararg);
diff --git a/src/othptab.c b/src/othptab.c
index 08574fb..dbd392c 100644
--- a/src/othptab.c
+++ b/src/othptab.c
@@ -766,7 +766,7 @@ void refresh_othwindow(struct othptable *table)
entry = table->firstvisible;
while ((entry != NULL) && (entry != table->lastvisible->next_entry)) {
- printothpentry(table, entry, target_row, 0, (FILE *) NULL);
+ printothpentry(table, entry, target_row, 0, NULL);
target_row++;
entry = entry->next_entry;
}
diff --git a/src/packet.c b/src/packet.c
index 841a495..3e7181a 100644
--- a/src/packet.c
+++ b/src/packet.c
@@ -122,7 +122,7 @@ static int packet_adjust(struct pkt_hdr *pkt)
/* return a NULL packet to signal an unrecognized link */
/* protocol to the caller. Hopefully, this switch statement */
/* will grow. */
- pkt->pkt_payload = (char *) NULL;
+ pkt->pkt_payload = NULL;
retval = -1;
break;
}
diff --git a/src/pktsize.c b/src/pktsize.c
index c6317ea..4715eff 100644
--- a/src/pktsize.c
+++ b/src/pktsize.c
@@ -49,7 +49,7 @@ static void write_size_log(struct ifstat_brackets *brackets,
char atime[TIME_TARGET_MAX];
int i;
- genatime(time((time_t *) NULL), atime);
+ genatime(time(NULL), atime);
fprintf(logfile, "*** Packet Size Distribution, generated %s\n\n",
atime);
fprintf(logfile, "Interface: %s MTU: %u\n\n", ifname, mtu);
diff --git a/src/rvnamed.c b/src/rvnamed.c
index b4795a6..6171f17 100644
--- a/src/rvnamed.c
+++ b/src/rvnamed.c
@@ -169,7 +169,7 @@ static void writervnlog(FILE * fd, char *msg)
time_t now;
char atime[TIME_TARGET_MAX] = "";
- now = time((time_t *) NULL);
+ now = time(NULL);
strcpy(atime, ctime(&now));
atime[strlen(atime) - 1] = '\0';
@@ -283,8 +283,7 @@ int main(void)
FD_SET(ifd, &sockset);
do {
- ss = select(ifd + 1, &sockset, NULL, NULL,
- (struct timeval *) NULL);
+ ss = select(ifd + 1, &sockset, NULL, NULL, NULL);
} while ((ss < 0) && (errno != ENOMEM));
if (errno == ENOMEM) {
diff --git a/src/serv.c b/src/serv.c
index 210d013..9a7e4e8 100644
--- a/src/serv.c
+++ b/src/serv.c
@@ -1137,7 +1137,7 @@ err_close:
err:
if (logging) {
signal(SIGUSR1, SIG_DFL);
- writeutslog(list.head, time((time_t *) NULL) - starttime,
+ writeutslog(list.head, time(NULL) - starttime,
options->actmode, logfile);
writelog(logging, logfile,
"******** TCP/UDP service monitor stopped ********");
diff --git a/src/tui/menurt.c b/src/tui/menurt.c
index 68dc689..b64a4c1 100644
--- a/src/tui/menurt.c
+++ b/src/tui/menurt.c
@@ -116,9 +116,9 @@ void tx_showitem(struct MENU *menu, struct ITEM *itemptr, int selected)
wattrset(menu->menuwin, loattr);
wprintw(menu->menuwin, "%s", strtok(curoption, "^"));
wattrset(menu->menuwin, hiattr);
- wprintw(menu->menuwin, "%s", strtok((char *) NULL, "^"));
+ wprintw(menu->menuwin, "%s", strtok(NULL, "^"));
wattrset(menu->menuwin, loattr);
- wprintw(menu->menuwin, "%s", strtok((char *) NULL, "^"));
+ wprintw(menu->menuwin, "%s", strtok(NULL, "^"));
strcpy(padding, "");
--
1.7.8.4