FWRITE: the third parameter is optional and if it is not given

we used the length of the string.

FSEEK: the third parameter is optional and if it is not given
we used FS_SET instead
This commit is contained in:
Manuel Ruiz
1999-05-05 13:32:40 +00:00
parent 0ef3e0972e
commit 99cd1b8eb9

View File

@@ -374,9 +374,10 @@ HARBOUR FWRITE()
long bytes=0;
if( arg1_it && arg2_it && arg3_it )
if( arg1_it && arg2_it )
{
bytes = _fsWrite(_parni(1),_parc(2),_parnl(3));
bytes = (arg3_it ? _parnl(3) : arg2_it->wLength );
bytes = _fsWrite(_parni(1),_parc(2),bytes);
last_error = errno;
}
@@ -445,10 +446,12 @@ HARBOUR FSEEK()
PITEM arg3_it = _param(3,IT_NUMBER);
long bytes=0;
if( arg1_it && arg2_it && arg3_it )
int pos;
if( arg1_it && arg2_it )
{
bytes = _fsSeek(_parni(1),_parnl(2),_parni(3));
pos = (arg3_it ? _parni(3) : FS_SET);
bytes = _fsSeek(_parni(1),_parnl(2),pos);
last_error = errno;
}