skalibs

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

bufalloc_clean.c (231B)


      1 /* ISC license. */
      2 
      3 #include <string.h>
      4 #include <skalibs/bufalloc.h>
      5 
      6 void bufalloc_clean (bufalloc *ba)
      7 {
      8   if (ba->p)
      9   {
     10     memmove(ba->x.s, ba->x.s + ba->p, ba->x.len - ba->p) ;
     11     ba->x.len -= ba->p ;
     12     ba->p = 0 ;
     13   }
     14 }