Reported by kernel's checkpatch.pl script.
/* Initialize it. */
struct itimerval it;
- memset(&it, 0, sizeof it);
+ memset(&it, 0, sizeof(it));
it.it_interval.tv_usec = 1;
setitimer(ITIMER_REAL, &it, NULL);
getitimer(ITIMER_REAL, &it);
{
char path[PATH_MAX + 1];
- return umovestr(tcp, upath, sizeof path, path) > 0 &&
+ return umovestr(tcp, upath, sizeof(path), path) > 0 &&
pathmatch(path);
}
continue;
len = strlen(pathname);
}
- else if (n > sizeof pathname - 1)
+ else if (n > sizeof(pathname) - 1)
continue;
else {
strncpy(pathname, path, n);
if (listen(0, 5))
perror_msg_and_skip("listen");
- memset(&addr, 0, sizeof addr);
+ memset(&addr, 0, sizeof(addr));
assert(getsockname(0, (struct sockaddr *) &addr, &len) == 0);
if (len > sizeof(addr))
len = sizeof(addr);
{
const off_t offset = 0xdefaceddeadbeefLL;
char buf[4];
- struct iovec iov = { buf, sizeof buf };
+ struct iovec iov = { buf, sizeof(buf) };
(void) close(0);
assert(open("/dev/zero", O_RDONLY) == 0);
- assert(pread(0, buf, sizeof buf, offset) == 4);
+ assert(pread(0, buf, sizeof(buf), offset) == 4);
assert(preadv(0, &iov, 1, offset) == 4);
assert(!close(0));
assert(open("/dev/null", O_WRONLY) == 0);
- assert(pwrite(0, buf, sizeof buf, offset) == 4);
+ assert(pwrite(0, buf, sizeof(buf), offset) == 4);
assert(pwritev(0, &iov, 1, offset) == 4);
assert(!close(0));
}
/* Cap path length to the path buffer size */
- if (n > sizeof path - 1)
- n = sizeof path - 1;
+ if (n > sizeof(path) - 1)
+ n = sizeof(path) - 1;
/* Fetch one byte more to find out whether path length > n. */
nul_seen = umovestr(tcp, addr, n + 1, path);