Skip to content

Commit

Permalink
Get rid of warnings on 32bit
Browse files Browse the repository at this point in the history
  • Loading branch information
bbonev committed Aug 13, 2023
1 parent d955b4b commit b5b9420
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
continue;
}
if (status) {
fprintf(stderr, "!!!Remnant of size %ld\n", status);
fprintf(stderr, "!!!Remnant of size %zd\n", status);
exit(1);
}
}
Expand Down Expand Up @@ -556,7 +556,7 @@ int addattr_l(struct nlmsghdr *n, int maxlen, int type, const void *data,
int len = RTA_LENGTH(alen);
struct rtattr *rta;

if (NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(len) > (ssize_t)maxlen) {
if (NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(len) > (size_t)maxlen) {
fprintf(stderr, "addattr_l ERROR: message exceeded bound of %d\n",maxlen);
return -1;
}
Expand All @@ -571,7 +571,7 @@ int addattr_l(struct nlmsghdr *n, int maxlen, int type, const void *data,

int addraw_l(struct nlmsghdr *n, int maxlen, const void *data, int len)
{
if (NLMSG_ALIGN(n->nlmsg_len) + NLMSG_ALIGN(len) > (ssize_t)maxlen) {
if (NLMSG_ALIGN(n->nlmsg_len) + NLMSG_ALIGN(len) > (size_t)maxlen) {
fprintf(stderr, "addraw_l ERROR: message exceeded bound of %d\n",maxlen);
return -1;
}
Expand Down Expand Up @@ -620,7 +620,7 @@ int rta_addattr32(struct rtattr *rta, int maxlen, int type, __u32 data)
int len = RTA_LENGTH(4);
struct rtattr *subrta;

if (RTA_ALIGN(rta->rta_len) + len > (ssize_t)maxlen) {
if (RTA_ALIGN(rta->rta_len) + len > (size_t)maxlen) {
fprintf(stderr,"rta_addattr32: Error! max allowed bound %d exceeded\n",maxlen);
return -1;
}
Expand All @@ -638,7 +638,7 @@ int rta_addattr_l(struct rtattr *rta, int maxlen, int type,
struct rtattr *subrta;
int len = RTA_LENGTH(alen);

if (RTA_ALIGN(rta->rta_len) + RTA_ALIGN(len) > (ssize_t)maxlen) {
if (RTA_ALIGN(rta->rta_len) + RTA_ALIGN(len) > (size_t)maxlen) {
fprintf(stderr,"rta_addattr_l: Error! max allowed bound %d exceeded\n",maxlen);
return -1;
}
Expand Down

0 comments on commit b5b9420

Please sign in to comment.