Mail Archives: djgpp-workers/2002/01/05/10:12:39
According to Richard Dawe:
> Any comments appreciated. Thanks, bye, Rich =]
>
> --
> Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
>
> Index: src/libc/fsext/fsext.c
> ===================================================================
> RCS file: /cvs/djgpp/djgpp/src/libc/fsext/fsext.c,v
> retrieving revision 1.3
> diff -p -u -3 -r1.3 fsext.c
> --- src/libc/fsext/fsext.c 2000/06/29 08:37:09 1.3
> +++ src/libc/fsext/fsext.c 2002/01/05 12:27:35
> @@ -1,3 +1,4 @@
> +/* Copyright (C) 2002 DJ Delorie, see COPYING.DJ for details */
> /* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
> /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
> /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
> @@ -88,11 +89,19 @@ grow_table(int _fd)
>
> if (num_fds <= _fd)
> {
> + __FSEXT_entry *temp;
> int old_fds = num_fds, i;
> +
> num_fds = (_fd+256) & ~255;
> - fsext_list = (__FSEXT_entry *)realloc(fsext_list, num_fds *
> sizeof(__FSEXT_entry));
> - if (fsext_list == 0)
> + temp = (__FSEXT_entry *)realloc(fsext_list, num_fds *
> sizeof(__FSEXT_entry));
Isn't it bad practice to cast the return value from
malloc(). Shouldn't realloc() be treated the same?
Your mailer breaks lines. That's not good if you want us to apply the
patches.
Right,
MartinS
- Raw text -