[Libguestfs] [PATCH 1/3] New API: case-sensitive-path to return case sensitive path on NTFS 3g fs

Jim Meyering jim at meyering.net
Mon Oct 26 13:38:55 UTC 2009


Matthew Booth wrote:

> On 26/10/09 09:20, Richard W.M. Jones wrote:
>> +char *
>> +do_case_sensitive_path (const char *path)
>> +{
>> +  char ret[PATH_MAX+1] = "/";
>
> Is PATH_MAX on Windows <= POSIX PATH_MAX? Does ntfs_3g honour this?
> Seems like a grey area. It would be safer to realloc this buffer as
> necessary. You also wouldn't need the strdup() at the end.

Good point.
There's another reason to avoid using PATH_MAX:
some systems don't define it at all,
and others define it to an outrageously (for stack use) large value.




More information about the Libguestfs mailing list