flag.h
flag.h copied to clipboard
Fix size multiplication overflow
If calculation of size based on its suffix overflows, then treat it as integer overflow. Otherwise, a wrong value is returned.
Keep suffixes for backwards compatibility, i.e. report an integer overflow, not an invalid suffix.
You can see the overflow in effect with compiled example, e.g. ./example -size 1Y which cannot fit in an unsigned long long, i.e. within 64 bit.