fmtvprint.c 449 B

12345678910111213141516171819202122232425262728293031
  1. #include <u.h>
  2. #include <libc.h>
  3. #include "fmtdef.h"
  4. /*
  5. * format a string into the output buffer
  6. * designed for formats which themselves call fmt,
  7. * but ignore any width flags
  8. */
  9. int
  10. fmtvprint(Fmt *f, char *fmt, va_list args)
  11. {
  12. va_list va;
  13. int n;
  14. f->flags = 0;
  15. f->width = 0;
  16. f->prec = 0;
  17. va = f->args;
  18. f->args = args;
  19. n = dofmt(f, fmt);
  20. f->flags = 0;
  21. f->width = 0;
  22. f->prec = 0;
  23. f->args = va;
  24. if(n >= 0)
  25. return 0;
  26. return n;
  27. }