Consistent arguments to sizeof().

In calls to functions taking a pointer 'p' and a length 'l':
if a struct variable v is passed in for p, then also pass sizeof(v) for
l.
pull/79/head
Frank Theile 2018-04-03 11:56:28 +02:00
parent 9d52f81058
commit f51c897d68
No known key found for this signature in database
GPG Key ID: 0791FC52837675ED
2 changed files with 2 additions and 2 deletions

View File

@ -386,7 +386,7 @@ int main(int argc, char **argv)
if (FD_ISSET(s[i], &rdfs)) {
nbytes = read(s[i], &frame, sizeof(struct can_frame));
nbytes = read(s[i], &frame, sizeof(frame));
if (nbytes < 0) {
perror("read");

View File

@ -305,7 +305,7 @@ int main(int argc, char *argv[])
}
/* Configure baud rate */
memset(&tios, 0, sizeof(struct termios));
memset(&tios, 0, sizeof(tios));
if (tcgetattr(fd, &tios) < 0) {
syslogger(LOG_NOTICE, "failed to get attributes for TTY device %s: %s\n", ttypath, strerror(errno));
exit(EXIT_FAILURE);