Assumption: A filename contains only one period.

The FAT file system allows only one period in a filename, as a delimiter. In that case, you know that the three characters following the period are the file extension. Under file systems that support long filenames, however, this is not true. What happens if your application scans a filename looking for a period in order to find the file extension? Here's a bit of code from one of my samples that (unfortunately) relies on this assumption:

// Strip off the extension, if any.
if (pDot = strstr (szLink, "."))
*pDot = (char)NULL;

// Add in the LNK extension.
lstrcat (szLink, ".LNK");

Had there been more than one period in the filename, my code would have failed to create a file of the correct type. A better way to get the name of the file, without the file extension, is to use a string function that returns the pointer to the extension by checking the string from the reverse:

if (pDot = strrchr (szLink, `.'))
*pDot = (char)NULL;

lstrcat (szLink, ".LNK");