This is actually a question about a huge number of winapi functions. A typical MS documentation says (from http://msdn.microsoft.com/en-us/library/bb762194%28VS.85%29.aspx ):
BOOL SHGetPathFromIDList( PCIDLIST_ABSOLUTE pidl, LPTSTR pszPath ); pidl [in] The address of an item identifier list that specifies a file or directory location relative to the root of the namespace (the desktop). pszPath [out] The address of a buffer to receive the file system path. This buffer must be at least MAX_PATH characters in size.
Nowhere does it say about whether a terminating 0 is written to pszPath. Also, it doesn't say whether the path can fill the pszPath, leaving no room for 0 there.
Googling around yeidls about 50/50 distribution of users who allocate a buffer with MAX_PATH+1 chars and users who only deal with MAX_PATH.
While I can certainly do something like char buf[MAX_PATH+1]={0} to be on the safe side, I would really like to know - is there some place where this stuff is described? Some page for all path-related functions maybe, I don't know...