diff --git a/examples/pf_ieee802154/pf_server.c b/examples/pf_ieee802154/pf_server.c index f2afa6775..941e9384c 100644 --- a/examples/pf_ieee802154/pf_server.c +++ b/examples/pf_ieee802154/pf_server.c @@ -70,9 +70,11 @@ static inline int check_buffer(unsigned char *buf) { j = 1; } + if (buf[j] != ch) { - printf("server: Buffer content error for offset=%d, index=%d\n", offset, j); + printf("server: Buffer content error for offset=%d, index=%d\n", + offset, j); ret = 0; } } @@ -95,6 +97,7 @@ int main(int argc, FAR char *argv[]) int nbytes; int optval; int offset; + int ret; /* Parse any command line options */ @@ -112,7 +115,9 @@ int main(int argc, FAR char *argv[]) /* Set socket to reuse address */ optval = 1; - if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (void*)&optval, sizeof(int)) < 0) + ret = setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (FAR void *)&optval, + sizeof(int)); + if (ret < 0) { printf("server: setsockopt SO_REUSEADDR failure: %d\n", errno); exit(1); @@ -124,7 +129,7 @@ int main(int argc, FAR char *argv[]) memcpy(&server.sa_addr, &g_server_addr, sizeof(struct ieee802154_saddr_s)); addrlen = sizeof(struct sockaddr_ieee802154_s); - if (bind(sockfd, (struct sockaddr*)&server, addrlen) < 0) + if (bind(sockfd, (FAR struct sockaddr *)&server, addrlen) < 0) { printf("server: bind failure: %d\n", errno); exit(1); @@ -170,14 +175,16 @@ int main(int argc, FAR char *argv[]) if (nbytes != SENDSIZE) { - printf("server: %d. recv size incorrect: %d vs %d\n", offset, nbytes, SENDSIZE); + printf("server: %d. recv size incorrect: %d vs %d\n", + offset, nbytes, SENDSIZE); close(sockfd); exit(1); } if (offset < inbuf[0]) { - printf("server: %d. %d packets lost, resetting offset\n", offset, inbuf[0] - offset); + printf("server: %d. %d packets lost, resetting offset\n", + offset, inbuf[0] - offset); offset = inbuf[0]; } else if (offset > inbuf[0]) diff --git a/examples/userfs/userfs_main.c b/examples/userfs/userfs_main.c index 83478cd29..1907352bc 100644 --- a/examples/userfs/userfs_main.c +++ b/examples/userfs/userfs_main.c @@ -215,7 +215,7 @@ static int ufstest_open(FAR void *volinfo, FAR const char *relpath, if (file != NULL) { opriv = (FAR struct ufstest_openfile_s *) - malloc(sizeof(struct ufstest_openfile_s )); + malloc(sizeof(struct ufstest_openfile_s)); if (opriv == NULL) { return -ENOMEM; @@ -420,7 +420,7 @@ static int ufstest_opendir(FAR void *volinfo, FAR const char *relpath, /* The path refers to the top level directory. */ odir = (FAR struct ufstest_opendir_s *) - malloc(sizeof(struct ufstest_opendir_s )); + malloc(sizeof(struct ufstest_opendir_s)); if (odir == NULL) { return -ENOMEM;