skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

stralloc_readyplus_tuned.c (298B)


      1 /* ISC license. */
      2 
      3 #include <errno.h>
      4 #include <skalibs/stralloc.h>
      5 
      6 int stralloc_readyplus_tuned (stralloc *sa, size_t n, size_t base, size_t a, size_t b)
      7 {
      8   size_t newlen = sa->len + n ;
      9   return newlen < sa->len ?
     10     (errno = ERANGE, 0) :
     11     stralloc_ready_tuned(sa, newlen, base, a, b) ;
     12 }