- 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)
This commit is contained in:
parent
baa8c35cb4
commit
0ddfc9486b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=218010
@ -72,7 +72,7 @@ struct usbcap_filehdr {
|
|||||||
static int doexit = 0;
|
static int doexit = 0;
|
||||||
static int pkt_captured = 0;
|
static int pkt_captured = 0;
|
||||||
static int verbose = 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 *r_arg = NULL;
|
||||||
static const char *w_arg = NULL;
|
static const char *w_arg = NULL;
|
||||||
static const char *errstr_table[USB_ERR_MAX] = {
|
static const char *errstr_table[USB_ERR_MAX] = {
|
||||||
@ -185,11 +185,10 @@ static void
|
|||||||
hexdump(const char *region, size_t len)
|
hexdump(const char *region, size_t len)
|
||||||
{
|
{
|
||||||
const char *line;
|
const char *line;
|
||||||
int x, c;
|
int x;
|
||||||
char lbuf[80];
|
int c;
|
||||||
#define EMIT(fmt, args...) do { \
|
#define EMIT(fmt, ...) do { \
|
||||||
sprintf(lbuf, fmt , ## args); \
|
printf(fmt,## __VA_ARGS__); \
|
||||||
printf("%s", lbuf); \
|
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
for (line = region; line < (region + len); line += 16) {
|
for (line = region; line < (region + len); line += 16) {
|
||||||
|
Loading…
Reference in New Issue
Block a user