libowfat/stralloc/stralloc_catlong0.c

14 lines
369 B
C
Raw Normal View History

2001-02-02 17:54:47 +00:00
#include "stralloc.h"
#include "fmt.h"
2006-11-07 17:56:05 +00:00
int stralloc_catlong0(stralloc *sa,signed long int in,size_t n) {
2014-03-14 19:42:54 +00:00
int neg=-(in<0);
if (neg) in=-in;
if (stralloc_readyplus(sa,fmt_minus(0,neg)+fmt_ulong0(0,(unsigned long)in,n))) {
sa->len+=fmt_minus(sa->s+sa->len,neg);
sa->len+=fmt_ulong0(sa->s+sa->len,(unsigned long)in,n);
2001-02-02 17:54:47 +00:00
return 1;
} else
return 0;
}