Re: [hatari-devel] FILENAME_MAX size?

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Le 22/05/2022 à 01:31, Eero Tamminen a écrit :
Hi,

According to Glibc docs, FILENAME_MAX should not be used:
https://www.gnu.org/software/libc/manual/html_node/Limits-for-Files.html

But it's used by Hatari for all configuration file paths...

Any idea whether the documented issue only specific to GNU/Hurd, or can FILENAME_MAX be set to something like MAX_INT also on other platforms?

Hi
I'm not aware of such issue, but in that case if we want to be safe, maybe we could just replace FILENAME_MAX by PATH_MAX ?

As PATH_MAX seems to not have this MAX_INT problem, it could solve this issue (PATH_MAX contains the path and the filename, so its size should be enough)

Or we could just set HATARI_FILENAME_MAX = 4096 and use it everywhere.

see this page for example for more detailled  informations :

https://stackoverflow.com/questions/65174086/is-there-any-difference-between-filename-max-and-path-max-in-c

Nicolas




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/