From 5678ba9e24c9b59097762e478989248a1da40b42 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Dani=C3=ABl=20Geelen?= Date: Wed, 2 May 2018 18:45:22 +0200 Subject: [PATCH] Wrap long lines. --- simavr/sim/run_avr.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/simavr/sim/run_avr.c b/simavr/sim/run_avr.c index c3a00c1..15925cb 100644 --- a/simavr/sim/run_avr.c +++ b/simavr/sim/run_avr.c @@ -140,7 +140,15 @@ main( uint16_t addr; char name[64]; } trace; - if(4 != sscanf(argv[pi], "%63[^=]=%63[^@]@0x%hx/0x%hhx", &trace.name[0], &trace.kind[0], &trace.addr, &trace.mask)) { + const int n_args = sscanf( + argv[pi], + "%63[^=]=%63[^@]@0x%hx/0x%hhx", + &trace.name[0], + &trace.kind[0], + &trace.addr, + &trace.mask + ); + if(n_args != 4) { --pi; fprintf(stderr, "%s: format for %s is name=kind@addr/mask.\n", argv[0], argv[pi]); exit(1); @@ -153,7 +161,12 @@ main( } else if(!strcmp(trace.kind, "trace")) { f.trace[f.tracecount].kind = AVR_MMCU_TAG_VCD_TRACE; } else { - fprintf(stderr, "%s: unknown trace kind '%s', not one of 'portpin', 'irq', or 'trace'.\n", argv[0], trace.kind); + fprintf( + stderr, + "%s: unknown trace kind '%s', not one of 'portpin', 'irq', or 'trace'.\n", + argv[0], + trace.kind + ); exit(1); } f.trace[f.tracecount].mask = trace.mask; -- 2.39.5