From 16e7325493a2163e0c0e0e3735647616a1808f43 Mon Sep 17 00:00:00 2001 From: Nick Hibma Date: Thu, 1 Dec 2016 09:14:58 +0000 Subject: [PATCH] Speling fixes and fix line endings for err_msg output. In some cases there was not \n, in other cases there was. --- usr.sbin/i2c/i2c.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/usr.sbin/i2c/i2c.c b/usr.sbin/i2c/i2c.c index 7714cf0b0e94..c9822a455393 100644 --- a/usr.sbin/i2c/i2c.c +++ b/usr.sbin/i2c/i2c.c @@ -310,7 +310,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c_buf) error = ioctl(fd, I2CWRITE, &cmd); free(buf); if (error == -1) { - err_msg = "ioctl: error when write offset"; + err_msg = "ioctl: error writing offset"; goto err1; } } @@ -335,7 +335,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c_buf) cmd.last = 0; error = ioctl(fd, I2CWRITE, &cmd); if (error == -1) { - err_msg = "ioctl: error when write"; + err_msg = "ioctl: error writing"; goto err1; } break; @@ -350,7 +350,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c_buf) error = ioctl(fd, I2CWRITE, &cmd); free(buf); if (error == -1) { - err_msg = "ioctl: error when write offset"; + err_msg = "ioctl: error writing offset"; goto err1; } } @@ -371,7 +371,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c_buf) cmd.last = 0; error = ioctl(fd, I2CWRITE, &cmd); if (error == -1) { - err_msg = "ioctl: error when write"; + err_msg = "ioctl: error writing"; goto err1; } break; @@ -394,7 +394,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c_buf) error = ioctl(fd, I2CWRITE, &cmd); free(buf); if (error == -1) { - err_msg = "ioctl: error when write"; + err_msg = "ioctl: error writing"; goto err1; } break; @@ -416,7 +416,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c_buf) fprintf(stderr, "error sending stop condtion\n"); err2: if (err_msg) - fprintf(stderr, "%s", err_msg); + fprintf(stderr, "%s\n", err_msg); close(fd); return (1); @@ -458,7 +458,7 @@ i2c_read(char *dev, struct options i2c_opt, char *i2c_buf) error = ioctl(fd, I2CWRITE, &cmd); free(buf); if (error == -1) { - err_msg = "ioctl: error when write offset"; + err_msg = "ioctl: error writing offset"; goto err1; } @@ -466,7 +466,7 @@ i2c_read(char *dev, struct options i2c_opt, char *i2c_buf) cmd.slave = i2c_opt.addr; error = ioctl(fd, I2CSTOP, &cmd); if (error == -1) { - err_msg = "error sending stop condtion\n"; + err_msg = "error sending stop condtion"; goto err2; } } @@ -491,7 +491,7 @@ i2c_read(char *dev, struct options i2c_opt, char *i2c_buf) } error = ioctl(fd, I2CSTOP, &cmd); if (error == -1) { - err_msg = "error sending stop condtion\n"; + err_msg = "error sending stop condtion"; goto err2; } @@ -513,7 +513,7 @@ i2c_read(char *dev, struct options i2c_opt, char *i2c_buf) fprintf(stderr, "error sending stop condtion\n"); err2: if (err_msg) - fprintf(stderr, "%s", err_msg); + fprintf(stderr, "%s\n", err_msg); close(fd); return (1);