summaryrefslogtreecommitdiff
path: root/src/libstddjb/long_fmt.c
blob: 552fe4713d10bfcf2d328c534c25bc23fada8775 (plain)
1
2
3
4
5
6
7
8
9
10
/* ISC license. */

#include <skalibs/ulong.h>

unsigned int long_fmt (char *fmt, long n)
{
  if (n >= 0) return ulong_fmt(fmt, n) ;
  if (fmt) *fmt++ = '-' ;
  return 1 + ulong_fmt(fmt, -n) ;
}