iron out all extra compiler warnings
[project/libnl-tiny.git] / attr.c
diff --git a/attr.c b/attr.c
index e0f50611cff9e94b5110a34ebfae32c86d47aba9..eae91e52bcacd7386999a978825a9dfff8a2fb3d 100644 (file)
--- a/attr.c
+++ b/attr.c
  */
 int nla_ok(const struct nlattr *nla, int remaining)
 {
-       return remaining >= sizeof(*nla) &&
+       size_t r = remaining;
+
+       return r >= sizeof(*nla) &&
               nla->nla_len >= sizeof(*nla) &&
-              nla->nla_len <= remaining;
+              nla->nla_len <= r;
 }
 
 /**