X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fopt%2Fhelpers.c;h=dfeb4e2e790a553173830d039ae84b8026df2fa8;hb=b3ae89992ecaffed31dcc2e912539c289478801a;hp=53fb0158827aca291e5ce39ff5566da60f49c8ec;hpb=bbdf3ef3c2c14e515388c6146fd00557cee905a1;p=ccan diff --git a/ccan/opt/helpers.c b/ccan/opt/helpers.c index 53fb0158..dfeb4e2e 100644 --- a/ccan/opt/helpers.c +++ b/ccan/opt/helpers.c @@ -66,8 +66,8 @@ char *opt_set_intval(const char *arg, int *i) if (err) return err; *i = l; - /* Beware truncation... */ - if (*i != l) + /* Beware truncation, but don't generate untestable code. */ + if (sizeof(*i) != sizeof(l) && *i != l) return arg_bad("value '%s' does not fit into an integer", arg); return err; }