Skip to content
Snippets Groups Projects
Commit e64d92df authored by dwf1m12's avatar dwf1m12
Browse files

fix an off-by-one error in ADP file preload

parent ec4ed910
No related branches found
No related tags found
No related merge requests found
...@@ -105,12 +105,13 @@ localparam BUFSIZE = (64 * 1024); ...@@ -105,12 +105,13 @@ localparam BUFSIZE = (64 * 1024);
$write("** %m : input file <%s> failed to open **\n", TXDFILENAME); $write("** %m : input file <%s> failed to open **\n", TXDFILENAME);
else begin else begin
while (!$feof(fd)) begin while (!$feof(fd)) begin
adpbuf[clen+25 + flen] <= $fgetc(fd); adpbuf[clen+25+1 + flen] = $fgetc(fd);
flen = flen +1; flen = flen +1;
end end
$write("** %m : file closed after stream TX completed **\n"); $write("** %m : file closed after stream TX completed **\n");
$fclose(fd); $fclose(fd);
end end
$write("** %m : input file length measured as: %d **\n", flen);
if (flen > 0) flen=flen-1; // correct for extra char count(???) if (flen > 0) flen=flen-1; // correct for extra char count(???)
// now output the entire adp buffer to the stream // now output the entire adp buffer to the stream
flen = flen + clen+25+1; flen = flen + clen+25+1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment