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

#include <skalibs/uint64.h>

size_t int64_fmt_generic (char *fmt, int64_t d, uint8_t base)
{
  if (d >= 0) return uint64_fmt_generic(fmt, (uint64_t)d, base) ;
  if (fmt) *fmt++ = '-' ;
  return 1 + uint64_fmt_generic(fmt, -(uint64_t)d, base) ;
}