diff options
author | Harald Welte <laforge@osmocom.org> | 2019-11-06 16:21:55 +0100 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2019-11-24 18:42:26 +0100 |
commit | 6df07292712df2afc49e01fd20b7e378680ff187 (patch) | |
tree | 182806b6defc813ca9a5a0fc5a8f1fcd4a6e34c9 /src/e1cap_dump.c | |
parent | 6f45dcdc2523a11e464364d190b53b16aa192087 (diff) |
fix various compiler warnings
Change-Id: I65a862132563f578eff11b8d085960b820f5d4b7
Diffstat (limited to 'src/e1cap_dump.c')
-rw-r--r-- | src/e1cap_dump.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/e1cap_dump.c b/src/e1cap_dump.c index 1986041..027aa82 100644 --- a/src/e1cap_dump.c +++ b/src/e1cap_dump.c @@ -53,7 +53,7 @@ static char *timeval2str(struct timeval *tv) time_t nowtime; struct tm *nowtm; char tmbuf[64]; - static char buf[64]; + static char buf[64+20]; nowtime = tv->tv_sec; nowtm = localtime(&nowtime); @@ -62,6 +62,7 @@ static char *timeval2str(struct timeval *tv) return buf; } +#if 0 static int all_bytes_are(unsigned char ch, const uint8_t *data, int len) { int i; @@ -72,6 +73,7 @@ static int all_bytes_are(unsigned char ch, const uint8_t *data, int len) } return 1; } +#endif static void handle_hdlc_frame_content(const uint8_t *data, unsigned int len, void *priv) @@ -151,6 +153,8 @@ static void handle_sc_in(struct osmo_e1cap_pkthdr *pkt, const uint8_t *data, uns static void handle_data(struct osmo_e1cap_pkthdr *pkt, uint8_t *data, int len) { + struct timeval tv; + flip_buf_bits(data, len); #if 0 /* filter out all-ff/all-fe/all-7f */ @@ -170,8 +174,10 @@ static void handle_data(struct osmo_e1cap_pkthdr *pkt, uint8_t *data, int len) switch (g_mode) { case MODE_PRINT: + tv.tv_sec = pkt->ts.tv_sec; + tv.tv_usec = pkt->ts.tv_usec; printf("%s %02u/%02u %u (%u): %s\n", - timeval2str(&pkt->ts), + timeval2str(&tv), pkt->line_nr, pkt->ts_nr, pkt->capture_mode, pkt->len, osmo_hexdump_nospc(data, len)); |