summaryrefslogtreecommitdiff
path: root/src/libstddjb/buffer_putflush.c
blob: 0443180de5e25efd37e9cd3d3199cbc8616180fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/* ISC license. */

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

ssize_t buffer_putflush (buffer *b, char const *s, size_t len)
{
  ssize_t r = buffer_put(b, s, len) ;
  if (r < 0) return -1 ;
  if (!buffer_flush(b)) return -1 ;
  return r ;
}