diff options
author | hselasky <hselasky@FreeBSD.org> | 2011-01-28 08:00:57 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2011-01-28 08:00:57 +0000 |
commit | 4d002160ce841251c6eae54ef713c0b159b250ea (patch) | |
tree | d5454258f36469d9c378b5d16596b79d2e488182 /usr.sbin | |
parent | 494df61f3bbd6b98dbe420f0854c6f0cb98ad36d (diff) | |
download | FreeBSD-src-4d002160ce841251c6eae54ef713c0b159b250ea.zip FreeBSD-src-4d002160ce841251c6eae54ef713c0b159b250ea.tar.gz |
- Remove double semicolon.
- Remove reference to sprintf. Use printf directly. This part of
the code should be optimised further to avoid many small printouts.
Setting a sensible line buffer length could help aswell when printing
out megabytes of data per second.
Approved by: thompsa (mentor)
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/usbdump/usbdump.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.sbin/usbdump/usbdump.c b/usr.sbin/usbdump/usbdump.c index c6f9048..c142f59 100644 --- a/usr.sbin/usbdump/usbdump.c +++ b/usr.sbin/usbdump/usbdump.c @@ -72,7 +72,7 @@ struct usbcap_filehdr { static int doexit = 0; static int pkt_captured = 0; static int verbose = 0; -static const char *i_arg = "usbus0";; +static const char *i_arg = "usbus0"; static const char *r_arg = NULL; static const char *w_arg = NULL; static const char *errstr_table[USB_ERR_MAX] = { @@ -185,11 +185,10 @@ static void hexdump(const char *region, size_t len) { const char *line; - int x, c; - char lbuf[80]; -#define EMIT(fmt, args...) do { \ - sprintf(lbuf, fmt , ## args); \ - printf("%s", lbuf); \ + int x; + int c; +#define EMIT(fmt, ...) do { \ + printf(fmt,## __VA_ARGS__); \ } while (0) for (line = region; line < (region + len); line += 16) { |