show_dir crashes on more than 200 columns
Pavel Tsekov
ptsekov at gmx.net
Wed Nov 3 11:50:25 UTC 2004
Hello,
On Wed, 3 Nov 2004, Leonard den Ottolander wrote:
> A small fix to avoid a crash in show_dir() with a panel of more than 200
> columns. Thanks to Vladimir.
>
> (Jindrich, a g_malloc0 and a free of tmp[] seem rather redundant here.)
No, it is not. You cannot rely on MC_MAXPATHLEN - it can be too small or
too big. For exmaple on Cygwin it is set to 259 . I remeber I've seen
also pretty big values for MAXPATHLEN which are not suitable for
allocating on the stack. Use the `widget.cols' and allocate memory from
the heap.
More information about the mc-devel
mailing list