Skip to content
This repository
Browse code

Prefer unsafe versions of _tcscpy and _tcsncpy in the interest of bac…

…kwards compatibility (e.g., WinXP)
  • Loading branch information...
commit c96688bd7994692d4f5a8b250e89d22cfa1ec5f6 1 parent bf66cdd
Alexander Davidson authored

Showing 1 changed file with 4 additions and 15 deletions. Show diff stats Hide diff stats

  1. 19  metapad.c
19  metapad.c
@@ -1612,11 +1612,7 @@ int FixShortFilename(TCHAR *szSrc, TCHAR *szDest)
1612 1612
 			}
1613 1613
 		}
1614 1614
 	
1615  
-		#ifndef __MINGW32__
1616  
-		_tcsncpy_s(sDir, MAXFN, szDest, nDestPos);
1617  
-		#else
1618 1615
 		_tcsncpy(sDir, szDest, nDestPos);		
1619  
-		#endif
1620 1616
 		sDir[nDestPos] = '*';
1621 1617
 		sDir[nDestPos + 1] = '\0';
1622 1618
 
@@ -1629,17 +1625,10 @@ int FixShortFilename(TCHAR *szSrc, TCHAR *szDest)
1629 1625
 		while (bOK && lstrcmpi(FindFileData.cFileName, sName) != 0 && lstrcmpi(FindFileData.cAlternateFileName, sName) != 0)
1630 1626
 			bOK = FindNextFile(hHandle, &FindFileData);
1631 1627
 
1632  
-        #ifndef __MINGW32__
1633  
-    		if (bOK)
1634  
-    			_tcscpy_s(&szDest[nDestPos], sizeof(FindFileData.cFileName), FindFileData.cFileName);
1635  
-    		else
1636  
-    			_tcscpy_s(&szDest[nDestPos], sizeof(sName), sName);
1637  
-		#else
1638  
-    		if (bOK)
1639  
-    			_tcscpy(&szDest[nDestPos], FindFileData.cFileName);
1640  
-    		else
1641  
-    			_tcscpy(&szDest[nDestPos], sName);
1642  
-		#endif
  1628
+    	if (bOK)
  1629
+    		_tcscpy(&szDest[nDestPos], FindFileData.cFileName);
  1630
+    	else
  1631
+    		_tcscpy(&szDest[nDestPos], sName);
1643 1632
 
1644 1633
 		// Fix the length of szDest
1645 1634
 		nDestPos = _tcslen(szDest);

0 notes on commit c96688b

Please sign in to comment.
Something went wrong with that request. Please try again.