mirror of
https://github.com/obarthel/amiga-smbfs.git
synced 2025-12-08 14:58:35 +00:00
Bug fix for random junk in first file data
smba_read() could end up returning random junk in the first few bytes of a file because the make_open() return value tripped it up.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* :ts=8
|
||||
* :ts=4
|
||||
*
|
||||
* Name: smb_abstraction.c
|
||||
* Description: Smb abstraction layer.
|
||||
@@ -407,6 +407,15 @@ smba_read (smba_file_t * f, char *data, long len, long offset)
|
||||
if (result < 0)
|
||||
goto out;
|
||||
|
||||
/* make_open() will return the number of bytes read
|
||||
from the server, or a negative number if an error
|
||||
occured. We just reset "result" to 0 here because
|
||||
it might otherwise cause the number of data bytes
|
||||
read to be off, which in turn causes the first
|
||||
few bytes read from a file to contain random
|
||||
junk. */
|
||||
result = 0;
|
||||
|
||||
D(("read %ld bytes from offset %ld",len,offset));
|
||||
|
||||
if (f->server->server.blkmode & 1)
|
||||
|
||||
Reference in New Issue
Block a user