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

#include <sys/types.h>
#include <errno.h>
#include <skalibs/buffer.h>

int buffer_getallnofill (buffer *b, char *s, size_t len)
{
  size_t r = buffer_getnofill(b, s, len) ;
  if (r < len)
  {
    buffer_unget(b, r) ;
    return (errno = ENOBUFS, 0) ;
  }
  return 1 ;
}