summaryrefslogtreecommitdiff
path: root/src/libstddjb/bufalloc_clean.c
blob: 467d524cd83b94c4c5d0612686c7082a12e86e7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* ISC license. */

#include <string.h>
#include <skalibs/bufalloc.h>

void bufalloc_clean (bufalloc *ba)
{
  if (ba->p)
  {
    memmove(ba->x.s, ba->x.s + ba->p, ba->x.len - ba->p) ;
    ba->x.len -= ba->p ;
    ba->p = 0 ;
  }
}