summaryrefslogtreecommitdiff
path: root/checkpasswd/buffer_copy.c
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2012-06-03 01:38:28 (GMT)
committerJohn Denker <jsd@av8n.com>2012-06-03 01:38:28 (GMT)
commit78488dc84afac1398e582ae6bbaf9606d07afa1e (patch)
tree71723e916f23a6a07422587de275dece3ea60252 /checkpasswd/buffer_copy.c
parent81b5f8f3ab26a7969956faef29a90499ece40ff5 (diff)
checkpassword ... as downloaded
Diffstat (limited to 'checkpasswd/buffer_copy.c')
-rw-r--r--checkpasswd/buffer_copy.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/checkpasswd/buffer_copy.c b/checkpasswd/buffer_copy.c
new file mode 100644
index 0000000..dc4d4b1
--- /dev/null
+++ b/checkpasswd/buffer_copy.c
@@ -0,0 +1,16 @@
+#include "buffer.h"
+
+int buffer_copy(buffer *bout,buffer *bin)
+{
+ int n;
+ char *x;
+
+ for (;;) {
+ n = buffer_feed(bin);
+ if (n < 0) return -2;
+ if (!n) return 0;
+ x = buffer_PEEK(bin);
+ if (buffer_put(bout,x,n) == -1) return -3;
+ buffer_SEEK(bin,n);
+ }
+}