I have the following line in my program that raises a warning at runtime:
if (!is_directory("C:\\NGFMS_Debug\\Files") && !create_directories("C:\\NGFMS_Debug\\Files"))
The warning text looks like this: "A buffer overflow occurred in XXX.exe, which damaged the internal state of the program."
A warning appears in the call to "is_directory (...)". I assume that the space for the line does not get allocated, but I thought that syntax like this was legal.
The is_directory function is part of boost / filesystem.hpp, and I use the following namespaces:
using namespace boost; using namespace boost::filesystem; using namespace std;
This is compilation under VS2005 C ++. Any ideas?
Update
I tried a couple of different things and went through the code, and here is what I found.
If i do it
char* path_chars_c; path_chars_c = "C:\\Debug\\Files"; string path_str_c(path_chars_c);
The path_chars_c variable contains the corresponding string, but the path_str_c variable contains garbage after initialization. Thus, it seems that here the line initialization is initialized. Has anyone ever seen this?
Ian
source share