title: FindFirstFile and FindNextFile question
body: <p>Output:  </p>
  
  <pre><code>The first file found is LOG_09.TXT
  Next file name is LOG_10.TXT
  Next file name is LOG_11.TXT
  Next fi                         (cut off word "file"?)
  </code></pre>
  
  <p>Function:</p>
  
  <pre><code>//Find last modified log file
      hFind = FindFirstFile("..\\..\\LOGS\\LOG*.TXT", &amp;FindFileData);
      if (hFind == INVALID_HANDLE_VALUE) 
      {
        printf ("FindFirstFile failed (%d)\n", GetLastError());
        return;
      } 
      else 
      {
        printf("The first file found is %s&lt;br&gt;",FindFileData.cFileName);
  
        //List all the other files in the directory.
        while (FindNextFile(hFind, &amp;FindFileData) != 0) 
        {
           printf ("Next file name is %s&lt;br&gt;", FindFileData.cFileName); //NOT DISPLAYING ALL NAMES CONSISTENTLY??
  
        }
  
        dwError = GetLastError();
        FindClose(hFind);
  
        if (dwError != ERROR_NO_MORE_FILES) 
        {
           printf ("FindNextFile error. Error is %u.\n", dwError);
           return (-1);
        }
  
      }
  </code></pre>
  
  <p>The word "file" is actually cut short in my printf. Sometimes it displays all the file names sometimes it displays a few, sometimes it doesn't even finish the printf quoted line, like shown above. What is causing this and am I being mislead by the printf functionality? In the debugger it looks like everything is OK, but I want to be certain and understand this. For example, I don't have a null char after i in file right? Why is it being cut off here? Thanks. </p>
  
  <p><strong>EDIT:</strong> <strong>Incorrect</strong> - Single threaded application library. (Was multithreaded before, sorry)  </p>
  
  <p>printing to a file gives the complete list of files while printf concurrently is "unstable". Not sure I understand why....</p>