Speling fixes and fix line endings for err_msg output.

In some cases there was not \n, in other cases there was.
This commit is contained in:
Nick Hibma 2016-12-01 09:14:58 +00:00
parent 03bc1fa2f9
commit 16e7325493
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=309357

View File

@ -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);