In time2sub() there is this code:
 
  } else {
    lo = 1;
    for (i = 0; i < (int) TYPE_BIT(time_t) - 1; ++i)
      lo *= 2;
    hi = -(lo + 1);
  }
 
The last *= 2 will overflow a signed integer time_t. This can be fixed with “lo = -1” instead of “lo = 1”.
This change seems to be consistent with the variable names.
 
- Jörg