Attachment #482598: Proposed patch v1 for win_rand.c for bug #596798

View | Details | Raw Unified | Return to bug 596798
Collapse All | Expand All

(-)win_rand.c (+2 lines)
Line     Link Here 
 Lines 151-156   EnumSystemFilesInFolder(Handler func, PR Link Here 
151
    	return;
151
    	return;
152
    // append *.* so we actually look for files.
152
    // append *.* so we actually look for files.
153
    _snwprintf(szFileName, _MAX_PATH, L"%s\\*.*", szSysDir);
153
    _snwprintf(szFileName, _MAX_PATH, L"%s\\*.*", szSysDir);
154
    szFileName[_MAX_PATH - 1] = 0;
154
155
155
    lFindHandle = FindFirstFileW(szFileName, &fdData);
156
    lFindHandle = FindFirstFileW(szFileName, &fdData);
156
    if (lFindHandle == INVALID_HANDLE_VALUE)
157
    if (lFindHandle == INVALID_HANDLE_VALUE)
 Lines 164-169   EnumSystemFilesInFolder(Handler func, PR Link Here 
164
	    // pass the full pathname to the callback
165
	    // pass the full pathname to the callback
165
	    _snwprintf(szFileName, _MAX_PATH, L"%s\\%s", szSysDir, 
166
	    _snwprintf(szFileName, _MAX_PATH, L"%s\\%s", szSysDir, 
166
		       fdData.cFileName);
167
		       fdData.cFileName);
168
	    szFileName[_MAX_PATH - 1] = 0;
167
	    if (fdData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
169
	    if (fdData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
168
		if (++uFolders <= MAX_FOLDERS)
170
		if (++uFolders <= MAX_FOLDERS)
169
		    EnumSystemFilesInFolder(func, szFileName, maxDepth - 1);
171
		    EnumSystemFilesInFolder(func, szFileName, maxDepth - 1);

Return to bug 596798