summaryrefslogtreecommitdiff
path: root/packages/base/src/C/vector-aux.c
diff options
context:
space:
mode:
Diffstat (limited to 'packages/base/src/C/vector-aux.c')
-rw-r--r--packages/base/src/C/vector-aux.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/base/src/C/vector-aux.c b/packages/base/src/C/vector-aux.c
index efb82af..2f47c8f 100644
--- a/packages/base/src/C/vector-aux.c
+++ b/packages/base/src/C/vector-aux.c
@@ -654,6 +654,9 @@ int zipQ(int code, KQVEC(a), KQVEC(b), QVEC(r)) {
654int vectorScan(char * file, int* n, double**pp){ 654int vectorScan(char * file, int* n, double**pp){
655 FILE * fp; 655 FILE * fp;
656 fp = fopen (file, "r"); 656 fp = fopen (file, "r");
657 if(!fp) {
658 ERROR(BAD_FILE);
659 }
657 int nbuf = 100*100; 660 int nbuf = 100*100;
658 double * p = (double*)malloc(nbuf*sizeof(double)); 661 double * p = (double*)malloc(nbuf*sizeof(double));
659 int k=0; 662 int k=0;
@@ -667,7 +670,7 @@ int vectorScan(char * file, int* n, double**pp){
667 if (k==nbuf) { 670 if (k==nbuf) {
668 nbuf = nbuf * 2; 671 nbuf = nbuf * 2;
669 p = (double*)realloc(p,nbuf*sizeof(double)); 672 p = (double*)realloc(p,nbuf*sizeof(double));
670 //printf("R\n"); 673 // printf("R\n");
671 } 674 }
672 p[k++] = d; 675 p[k++] = d;
673 } 676 }