#16 gflags patch

trunk
closed-fixed
modules (179)
5
2008-08-30
2008-08-30
Richard Revels
No

Small patch to gflags.c to make gflags work as documented. This will break anyone using gflags currently of course but it should be noted that without this change using set_gflag 32 in script not only won't work as expected but will overflow the gflag buffer.

Discussion

  • Richard Revels
    Richard Revels
    2008-08-30

    patch to be applied against gflags.c

     
    Attachments
  • Richard Revels
    Richard Revels
    2008-08-30

    Logged In: YES
    user_id=499549
    Originator: YES

    Poor choice of words there. Will overflow the gflag buffer into the ozone. No danger of memory corruption or anything.

     
    • milestone: --> trunk
    • assigned_to: nobody --> bogdan_iancu
    • status: open --> closed-fixed
     
  • Logged In: YES
    user_id=1275325
    Originator: NO

    Hi Richard,

    I do not see problem. In fixup_gflags(), myint is originally a bit index between 0 and 31, and not between 1 and 32 - the only error is in the error print message and in the docs (flag 0 is also available).

    Also the condition in mi_is_gflag(), indeed was broken - it was testing if at least one flag is set instead of testing if all the flags are set.

    Fixes (code and docs) are available on trunk and 1.4 branch.

    Thanks and regards,
    Bogdan

    PS: if something missed me, please re-open the bug.