mirror of
https://github.com/linux-can/can-utils.git
synced 2026-09-23 08:31:09 +02:00
Add missing return value checks
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
This commit is contained in:
+6
-3
@@ -690,12 +690,15 @@ void writesettings(char* name){
|
||||
|
||||
for (i=0; i < 2048 ;i++) {
|
||||
sprintf(buf, "<%03X>%c.", i, (is_set(i, ENABLE))?'1':'0');
|
||||
write(fd, buf, 7);
|
||||
if (write(fd, buf, 7) < 0)
|
||||
perror("write");
|
||||
for (j=0; j<8 ; j++){
|
||||
sprintf(buf, "%02X", sniftab[i].notch.data[j]);
|
||||
write(fd, buf, 2);
|
||||
if (write(fd, buf, 2) < 0)
|
||||
perror("write");
|
||||
}
|
||||
write(fd, "\n", 1);
|
||||
if (write(fd, "\n", 1) < 0)
|
||||
perror("write");
|
||||
/* 7 + 16 + 1 = 24 bytes per entry */
|
||||
}
|
||||
close(fd);
|
||||
|
||||
Reference in New Issue
Block a user