summaryrefslogtreecommitdiff
path: root/pith/readfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'pith/readfile.c')
-rw-r--r--pith/readfile.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pith/readfile.c b/pith/readfile.c
index cae03fc1..e918ec99 100644
--- a/pith/readfile.c
+++ b/pith/readfile.c
@@ -78,6 +78,7 @@ our_copy(char *to_file, char *from_file)
{
STORE_S *in_cert, *out_cert;
unsigned char c;
+ long int size = 0;
in_cert = so_get(FileStar, from_file, READ_ACCESS | READ_FROM_LOCALE);
if (in_cert == NULL)
@@ -89,9 +90,14 @@ our_copy(char *to_file, char *from_file)
return -1;
}
- while(so_readc(&c, in_cert) > 0)
- so_writec(c, out_cert);
+ so_seek(out_cert, 0L, 0);
+ so_truncate(out_cert, 0);
+ while(so_readc(&c, in_cert) > 0){
+ so_writec(c, out_cert);
+// size++;
+ }
+// so_truncate(out_cert, size);
so_give(&in_cert);
so_give(&out_cert);