- /* Make sure nothing stupid happens */
- /* DO NOT REMOVE THE (int) CAST! Incorrect results will
- follow! */
- spec->precision = min (spec->precision,
- (int) (sizeof (text_to_print) - 50));
-
- constructed_spec[0] = 0;
- strcat (constructed_spec, "%");
- if (spec->plus_flag)
- strcat (constructed_spec, "+");
- if (spec->space_flag)
- strcat (constructed_spec, " ");
- if (spec->number_flag)
- strcat (constructed_spec, "#");
+ *p++ = '%';
+ if (spec->plus_flag) *p++ = '+';
+ if (spec->space_flag) *p++ = ' ';
+ if (spec->number_flag) *p++ = '#';
+ if (spec->minus_flag) *p++ = '-';
+ if (spec->zero_flag) *p++ = '0';
+
+ if (spec->minwidth >= 0)
+ p = long_to_string (p, spec->minwidth);