In my local version I imported the fix for #46 using a break in that place, which is IMHO the more natural choice, as you normally don't expect the usage() display to cause any side-effects on your program configuration, thus resulting in the following code locally instead:
case 'h': /* help */
usage();
break;
Given that usage() internally calls exit(1); this is even stranger, as this comment causes the expectation of the code continuing after the call to usage(); returns.
While looking through my local changes I noticed a small difference between the local changes and the upstream
develop
branch:https://github.com/atomicobject/heatshrink/blob/ffd95059ff9155fa373b3e6276854db3ad7b4e3c/src/heatshrink.c#L410-L412
In my local version I imported the fix for #46 using a
break
in that place, which is IMHO the more natural choice, as you normally don't expect theusage()
display to cause any side-effects on your program configuration, thus resulting in the following code locally instead:Given that
usage()
internally callsexit(1);
this is even stranger, as this comment causes the expectation of the code continuing after the call tousage();
returns.