On Mon, 04 Sep 2006 15:18:59 +0100, James Hunkins <[EMAIL PROTECTED]>  
wrote:

> Guys,
>
> I think that I found a bug in the qlib_h include file used by C68.
> Here are the details:
>
> In the 'qdirect' structure, the member 'd_name' is defined as:
>       char d_name[36];
>
> This works as long as the directory/file name is 35 or fewer
> characters and holds a properly terminated C string (terminates with
> a '0').  However, if the total name length is actually 36 characters,
> then there is no termination.  As far as I can tell the structure
> does properly hold everything and isn't corrupt, just no termination
> in that one case.
>
> This might explain why in a few problems with long file names, I see
> handling problems but not in others (compiled in C68 versus assembly
> or compiled SBASIC for example?).
>
> If I am correct this structure should define it as:
>
>       char d_name[37];
>
> to allow room for the termination character of a C string.
>

Jim,

Yes you are of course correct - however, just to be on the safe side, it  
should really be set to

char d_name[42]

this allows the device name (5 chars) as well as the terminating character.

Now - can anyone tell me why if you use FSERVE, the network name including  
n1_ (or whatever) to access a remote file is restricted to 39 characters?   
As a result of this, the full 41 characters should never be used.


-- 
Rich Mellor
RWAP Services
URL:http://www.rwapsoftware.co.uk
URL:http://www.rwapadventures.com
URL:http://www.rwapservices.co.uk
URL:http://www.internetbusinessangels.com

_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to