Sorry to be a pain, but I now remember that there's similar code in
diffutils/lib/cmpbuf.c's buffer_lcm function. It attempts to yield
reasonable values if buffer sizes are zero, and it does a sanity check
against maximum "reasonable" values. This all came about because of
freaky buffer sizes in various operating systems, so I expect we'd run
into similar problems here.
Suppose we just split out buffer_lcm into a separate module and use
that?