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 \
vmod_##func(VRT_CTX) \
{ \
struct type *s; \
id##_t i; \
VCL_INT ret; \
VCL_STRING name; \
\
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
i = (id##_t) vmod_##id(ctx); \
if (i == -1) \
ret = vmod_##id(ctx); \
if (ret == -1) \
return (NULL); \
\
errno = 0; \
s = get(i); \
s = get((id##_t) ret); \
if (s == NULL) { \
ERRNOCREDS(ctx); \
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