fix build warning (#2365)

* fix build warning

* Update selfdrive/common/util.c

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 0bbd080a04
commatwo_master
Dean Lee 5 years ago committed by GitHub
parent 2f20a1d5b4
commit 1089f8fa8f
  1. 2
      selfdrive/common/util.c

@ -52,7 +52,7 @@ int write_file(const char* path, const void* data, size_t size) {
}
ssize_t n = write(fd, data, size);
close(fd);
return n == size ? 0 : -1;
return (n >= 0 && (size_t)n == size) ? 0 : -1;
}
void set_thread_name(const char* name) {

Loading…
Cancel
Save