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

#include <skalibs/cbuffer.h>

size_t cbuffer_unget (cbuffer_t *b, size_t len)
{
  size_t max = cbuffer_available(b) ;
  if (len > max) len = max ;
  return cbuffer_UNGET(b, len) ;
}