You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
276 B
16 lines
276 B
#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);
|
|
}
|
|
}
|
|
|