flexelint vmod_unix

Solve comparison between unsigned and -1 by moving a cast to where we need it.

the existing code already implied that a VCL_INT be large enough to hold
uid_t / gid_t.
parent 4b6ade1d
...@@ -123,16 +123,16 @@ VCL_STRING \ ...@@ -123,16 +123,16 @@ VCL_STRING \
vmod_##func(VRT_CTX) \ vmod_##func(VRT_CTX) \
{ \ { \
struct type *s; \ struct type *s; \
id##_t i; \ VCL_INT ret; \
VCL_STRING name; \ VCL_STRING name; \
\ \
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \ CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
i = (id##_t) vmod_##id(ctx); \ ret = vmod_##id(ctx); \
if (i == -1) \ if (ret == -1) \
return (NULL); \ return (NULL); \
\ \
errno = 0; \ errno = 0; \
s = get(i); \ s = get((id##_t) ret); \
if (s == NULL) { \ if (s == NULL) { \
ERRNOCREDS(ctx); \ ERRNOCREDS(ctx); \
return (NULL); \ return (NULL); \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment