diff --git a/source_code/smb_abstraction.c b/source_code/smb_abstraction.c index 5bbf056..dbdac00 100644 --- a/source_code/smb_abstraction.c +++ b/source_code/smb_abstraction.c @@ -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)