delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/12/01/11:40:01

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
Date: Sat, 01 Dec 2001 18:35:13 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
Message-Id: <2945-Sat01Dec2001183513+0200-eliz@is.elta.co.il>
X-Mailer: emacs 21.1.50 (via feedmail 8 I) and Blat ver 1.8.9
CC: djgpp-workers AT delorie DOT com
In-reply-to: <3C08FA41.B9181F10@phekda.freeserve.co.uk> (message from Richard
Dawe on Sat, 01 Dec 2001 15:41:53 +0000)
Subject: Re: st_blksize patch, revision 4
References: <3C08FA41 DOT B9181F10 AT phekda DOT freeserve DOT co DOT uk>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Date: Sat, 01 Dec 2001 15:41:53 +0000
> From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
> 
> OK to commit?

Yes, but...

> *** include/libc/fd_props.h     2001/06/06 21:09:50     1.6
> --- include/libc/fd_props.h     2001/12/01 15:28:38
> *************** extern "C" {
> *** 8,13 ****
> --- 8,15 ----
>   
>   #ifndef __dj_ENFORCE_ANSI_FREESTANDING
>   
> + #include <string.h>

Why did you need to include string.h in fd_props.h?

>   #ifndef  NO_ST_BLKSIZE
> !   if (__get_fd_name(fhandle))
> !     {
> !       const char *filename;
> !       char fixed_filename[PATH_MAX + 1];
> ! 
> !       filename = __get_fd_name(fhandle);
> !       _fixpath(filename, fixed_filename);

This will bomb if __get_fd_name returns NULL.  I think you should
recover gracefully in that case, probably return the transfer buffer
size or something.  Or maybe fail the whole thing, if you must, just
don't crash.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019