
On Wed, Sep 22, 2010 at 13:42, Timothy Madden
I think that somehow the template constructor for paths takes the entire array passed as argument and not just the null-terminated string inside the array, which may be smaller.
That's plausible. A number of places in boost like to do that because it allows for embedded nulls in string literals: path p("1234\0abc"); Considering that every filesystem I know of doesn't accept nulls, though, it really doesn't matter for paths. You can get the expected behavour from your code with fs::path p((char const*)b); I suspect it's just that nobody ever considered people using char arrays that weren't string literals, since the "boost way" would have it inside a vector or boost::array, and do fs::path(array.data()) which wouldn't trigger the problem. HTH, ~ Scott