While I’m to tired to understand why this writes past the end of the array

#include <assert.h>
#define bounds(_i, _n) (assert( (unsigned) (_i) < (_n) ), (_i) )
....

/*
* fout is what we are appending to and should be open rw as necessary.
* farray is an array of file pointers, "farsize" is the size of the array.
*/
void
concatenate( FILE *fout, FILE *farray[], const unsigned char *farsize) {

int c;
unsigned int fi = 1;
FILE *fin; /* current segment of farray[] to fout. */

while ( (fi < farsize[0])) {
fin = farray[bounds(fi, *farsize)];
fi++;
while ( (c = fgetc(fin )) != EOF ) {
fputc( c, fout );
}
}
}

I’m GOING TO BED. 0832 Zulu time on my clock…. must sleeep sleep….

what is that again?

1 thought on “”

Comments are closed.