diff options
-rw-r--r-- | commandline/i2cget.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/commandline/i2cget.c b/commandline/i2cget.c index 95243d4..f27ea51 100644 --- a/commandline/i2cget.c +++ b/commandline/i2cget.c @@ -66,9 +66,10 @@ int main(int argc, char **argv) return 3; } - for (i = 0; i < num_bytes; i++) { - printf("%i\n", i2c_hw_rx_byte(1)); + for (i = 1; i <= num_bytes; i++) { + printf("%i ", i2c_hw_rx_byte((i < num_bytes) * 1)); } + putc('\n', stdout); i2c_hw_stop(); i2c_deinit(); |