diff options
author | David Tardon <dtardon@redhat.com> | 2022-08-09 14:35:15 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2022-09-13 08:13:27 +0200 |
commit | 995340074e554b4bf4a0fdb0cb7436692c5a4ffd (patch) | |
tree | ca3ee001db3e608ee80478f42fea9c3b409f1b7b /src/basic/io-util.c | |
parent | Merge pull request #23087 from yuwata/udev-watch (diff) | |
download | systemd-995340074e554b4bf4a0fdb0cb7436692c5a4ffd.tar.xz systemd-995340074e554b4bf4a0fdb0cb7436692c5a4ffd.zip |
tree-wide: use ASSERT_PTR more
Diffstat (limited to 'src/basic/io-util.c')
-rw-r--r-- | src/basic/io-util.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/basic/io-util.c b/src/basic/io-util.c index a591a75c37..cdad939aa6 100644 --- a/src/basic/io-util.c +++ b/src/basic/io-util.c @@ -49,11 +49,10 @@ int flush_fd(int fd) { } ssize_t loop_read(int fd, void *buf, size_t nbytes, bool do_poll) { - uint8_t *p = buf; + uint8_t *p = ASSERT_PTR(buf); ssize_t n = 0; assert(fd >= 0); - assert(buf); /* If called with nbytes == 0, let's call read() at least * once, to validate the operation */ @@ -108,10 +107,9 @@ int loop_read_exact(int fd, void *buf, size_t nbytes, bool do_poll) { } int loop_write(int fd, const void *buf, size_t nbytes, bool do_poll) { - const uint8_t *p = buf; + const uint8_t *p = ASSERT_PTR(buf); assert(fd >= 0); - assert(buf); if (_unlikely_(nbytes > (size_t) SSIZE_MAX)) return -EINVAL; |