+ }
+
+ // The user could theoretically ask for a silly buffer length here.
+ // Perhaps after a certain size we should malloc? Or do we refuse to protect
+ // them from their own stupidity?
+ size_t bufLen = (status->width > maxIntLen ? status->width : maxIntLen) + 2;
+ char outbuf[bufLen];
+ char * outend = outbuf + bufLen;
+ int written = 0;
+
+ // Build up our output string - backwards
+ {
+ const char * digits = (status->flags & E_lower) ?
+ _PDCLIB_digits : _PDCLIB_Xdigits;
+ uintmax_t remaining = value;
+ if(status->prec != 0 || remaining != 0) do {
+ uintmax_t digit = remaining % status->base;
+ remaining /= status->base;
+
+ outend[-++written] = digits[digit];
+ } while(remaining != 0);
+ }
+
+ // Pad field out to the precision specification
+ while( (long) written < status->prec ) outend[-++written] = '0';
+
+ // If a field width specified, and zero padding was requested, then pad to
+ // the field width
+ unsigned padding = 0;
+ if ( ( ! ( status->flags & E_minus ) ) && ( status->flags & E_zero ) )
+ {
+ while( written < status->width )