projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert sizeof foo to sizeof(foo).
[tinc]
/
src
/
sptps_test.c
diff --git
a/src/sptps_test.c
b/src/sptps_test.c
index
8df1046
..
e7dcea2
100644
(file)
--- a/
src/sptps_test.c
+++ b/
src/sptps_test.c
@@
-221,7
+221,7
@@
int main(int argc, char *argv[]) {
#endif
struct addrinfo *ai, hint;
#endif
struct addrinfo *ai, hint;
- memset(&hint, 0, sizeof
hint
);
+ memset(&hint, 0, sizeof
(hint)
);
hint.ai_family = addressfamily;
hint.ai_socktype = datagram ? SOCK_DGRAM : SOCK_STREAM;
hint.ai_family = addressfamily;
hint.ai_socktype = datagram ? SOCK_DGRAM : SOCK_STREAM;
@@
-240,7
+240,7
@@
int main(int argc, char *argv[]) {
}
int one = 1;
}
int one = 1;
- setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof
one
);
+ setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof
(one)
);
if(initiator) {
if(connect(sock, ai->ai_addr, ai->ai_addrlen)) {
if(initiator) {
if(connect(sock, ai->ai_addr, ai->ai_addrlen)) {
@@
-271,9
+271,9
@@
int main(int argc, char *argv[]) {
char buf[65536];
struct sockaddr addr;
char buf[65536];
struct sockaddr addr;
- socklen_t addrlen = sizeof
addr
;
+ socklen_t addrlen = sizeof
(addr)
;
- if(recvfrom(sock, buf, sizeof
buf
, MSG_PEEK, &addr, &addrlen) <= 0) {
+ if(recvfrom(sock, buf, sizeof
(buf)
, MSG_PEEK, &addr, &addrlen) <= 0) {
fprintf(stderr, "Could not read from socket: %s\n", sockstrerror(sockerrno));
return 1;
}
fprintf(stderr, "Could not read from socket: %s\n", sockstrerror(sockerrno));
return 1;
}
@@
-331,7
+331,7
@@
int main(int argc, char *argv[]) {
return 1;
if(FD_ISSET(in, &fds)) {
return 1;
if(FD_ISSET(in, &fds)) {
- ssize_t len = read(in, buf, sizeof
buf
);
+ ssize_t len = read(in, buf, sizeof
(buf)
);
if(len < 0) {
fprintf(stderr, "Could not read from stdin: %s\n", strerror(errno));
return 1;
if(len < 0) {
fprintf(stderr, "Could not read from stdin: %s\n", strerror(errno));
return 1;
@@
-351,12
+351,12
@@
int main(int argc, char *argv[]) {
if(len > 1)
sptps_send_record(&s, 0, buf, len);
} else
if(len > 1)
sptps_send_record(&s, 0, buf, len);
} else
- if(!sptps_send_record(&s, buf[0] == '!' ? 1 : 0, buf, (len == 1 && buf[0] == '\n') ? 0 : buf[0] == '*' ? sizeof
buf
: len))
+ if(!sptps_send_record(&s, buf[0] == '!' ? 1 : 0, buf, (len == 1 && buf[0] == '\n') ? 0 : buf[0] == '*' ? sizeof
(buf)
: len))
return 1;
}
if(FD_ISSET(sock, &fds)) {
return 1;
}
if(FD_ISSET(sock, &fds)) {
- ssize_t len = recv(sock, buf, sizeof
buf
, 0);
+ ssize_t len = recv(sock, buf, sizeof
(buf)
, 0);
if(len < 0) {
fprintf(stderr, "Could not read from socket: %s\n", sockstrerror(sockerrno));
return 1;
if(len < 0) {
fprintf(stderr, "Could not read from socket: %s\n", sockstrerror(sockerrno));
return 1;