1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-01 09:10:37 +00:00

Update libqb.cpp

When opening a file for random access, if the LEN is not supplied, it defaults the length correctly, but does not allocate the buffer correctly. The code should reference the record_length in the file struct.
This commit is contained in:
Lynn Stricklan 2021-01-05 14:39:18 -07:00
parent 69ab2d3327
commit 87c01d0bed

View file

@ -13037,7 +13037,7 @@ void sub_open(qbs *name,int32 type,int32 access,int32 sharing,int32 i,int64 reco
if (type==1){//set record length
f->record_length=128;
if (passed) if (record_length!=-1) f->record_length=record_length;
f->field_buffer=(uint8*)calloc(record_length,1);
f->field_buffer=(uint8*)calloc(f->record_length,1);
}
if (type==5){//seek eof