summaryrefslogtreecommitdiff
path: root/util/cbfstool/xdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/cbfstool/xdr.c')
-rw-r--r--util/cbfstool/xdr.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/util/cbfstool/xdr.c b/util/cbfstool/xdr.c
index e2cafd14b4..df2c4ba4a0 100644
--- a/util/cbfstool/xdr.c
+++ b/util/cbfstool/xdr.c
@@ -25,7 +25,7 @@
#include <stdint.h>
#include "common.h"
-int bgets(struct buffer *input, void *output, size_t len)
+size_t bgets(struct buffer *input, void *output, size_t len)
{
len = input->size < len ? input->size : len;
memmove(output, input->data, len);
@@ -34,6 +34,13 @@ int bgets(struct buffer *input, void *output, size_t len)
return len;
}
+size_t bputs(struct buffer *b, const void *data, size_t len)
+{
+ memmove(&b->data[b->size], data, len);
+ b->size += len;
+ return len;
+}
+
/* The assumption in all this code is that we're given a pointer to enough data.
* Hence, we do not check for underflow.
*/