Skip to content
  • Ondřej Surý's avatar
    Ensure name count stays positive in remove_nodes() · 12f6a442
    Ondřej Surý authored
    This fixes a scan-build false-positive:
    
    rbt_test.c:914:8: warning: Assigned value is garbage or undefined
                    node %= *names_count;
                         ^  ~~~~~~~~~~~~
    1 warning generated.
    
    The remove_nodes() function is always called with correct arguments
    (num_names is in <1;*names_count> range), so the modulo by zero cannot
    happen, but nevertheless scan-build detects this and it's easy to fix.
    12f6a442