Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
369 B

21 years ago
21 years ago
  1. #include "stralloc.h"
  2. #include "fmt.h"
  3. int stralloc_catlong0(stralloc *sa,signed long int in,size_t n) {
  4. int neg=-(in<0);
  5. if (neg) in=-in;
  6. if (stralloc_readyplus(sa,fmt_minus(0,neg)+fmt_ulong0(0,(unsigned long)in,n))) {
  7. sa->len+=fmt_minus(sa->s+sa->len,neg);
  8. sa->len+=fmt_ulong0(sa->s+sa->len,(unsigned long)in,n);
  9. return 1;
  10. } else
  11. return 0;
  12. }