a couple more system calls wrapped in syscall.c
[rsync/rsync.git] / io.c
diff --git a/io.c b/io.c
index b5ceff1..1b2fb22 100644 (file)
--- a/io.c
+++ b/io.c
@@ -134,6 +134,7 @@ static int readfd(int fd,char *buffer,int N)
                        memcpy(buffer+total,read_buffer_p,ret);
                        read_buffer_p += ret;
                        read_buffer_len -= ret;
+                       total += ret;
                        continue;
                } 
 
@@ -217,6 +218,12 @@ void read_buf(int f,char *buf,int len)
   total_read += len;
 }
 
+void read_sbuf(int f,char *buf,int len)
+{
+       read_buf(f,buf,len);
+       buf[len] = 0;
+}
+
 unsigned char read_byte(int f)
 {
   unsigned char c;