Mail Archives: djgpp-workers/2001/12/01/12:35:45
Hello.
Eli Zaretskii wrote:
> Why did you need to include string.h in fd_props.h?
To get a definition for NULL.
> Richard Dawe wrote:
> > #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.
The 'if (true)' part is conditional on __get_fd_name() returning non-zero,
so filename will never be NULL. Maybe I should explicitly check that it's
non-NULL, rather than assuming NULL == 0:
if (__get_fd_name(fhandle) != NULL)
{
...
}
I've just noticed _STAT_* are defined in fstat.c & lstat.c too, so I'll
remove those. There are some combinations of stat flags, e.g.
_STAT_EXECBIT, that are used in *stat.c. Shall I move these to sys/stat.h
and document in __djstat_flags texinfo docs?
Thanks, bye, Rich =]
--
Richard Dawe
http://www.phekda.freeserve.co.uk/richdawe/
- Raw text -