Author: tfaber
Date: Mon Apr 28 08:06:52 2014
New Revision: 63030
URL:
http://svn.reactos.org/svn/reactos?rev=63030&view=rev
Log:
[FIND]
- Avoid printf on a non-format string. Spotted by Víctor
- Remove broken pseudo-TCHAR usage
CORE-8112 #resolve
Modified:
trunk/reactos/base/applications/cmdutils/find/find.c
Modified: trunk/reactos/base/applications/cmdutils/find/find.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/find/find.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/cmdutils/find/find.c [iso-8859-1] Mon Apr 28 08:06:52
2014
@@ -125,11 +125,11 @@
void
usage (void)
{
- TCHAR lpUsage[4096];
-
- LoadString( GetModuleHandle(NULL), IDS_USAGE, (LPTSTR)lpUsage, 4096);
- CharToOem(lpUsage, lpUsage);
- printf( lpUsage );
+ char szUsage[4096];
+
+ LoadStringA (GetModuleHandle (NULL), IDS_USAGE, szUsage, sizeof(szUsage) /
sizeof(szUsage[0]));
+ CharToOemA (szUsage, szUsage);
+ fputs (szUsage, stdout);
}
@@ -139,7 +139,7 @@
{
char *opt, *needle = NULL;
int ret = 0;
- TCHAR lpMessage[4096];
+ char szMessage[4096];
int invert_search = 0; /* flag to invert the search */
int count_lines = 0; /* flag to whether/not count lines */
@@ -216,9 +216,9 @@
{
/* We were not able to find a file. Display a message and
set the exit status. */
- LoadString( GetModuleHandle(NULL), IDS_NO_SUCH_FILE, (LPTSTR)lpMessage, 4096);
- CharToOem(lpMessage, lpMessage);
- fprintf (stderr, lpMessage, *argv);//
+ LoadStringA (GetModuleHandle (NULL), IDS_NO_SUCH_FILE, szMessage, sizeof(szMessage) /
sizeof(szMessage[0]));
+ CharToOemA (szMessage, szMessage);
+ fprintf (stderr, szMessage, *argv);
}
else
{
@@ -235,9 +235,9 @@
}
else
{
- LoadString(GetModuleHandle(NULL), IDS_CANNOT_OPEN, (LPTSTR)lpMessage, 4096);
- CharToOem(lpMessage, lpMessage);
- fprintf (stderr, lpMessage,
+ LoadString (GetModuleHandle (NULL), IDS_CANNOT_OPEN, szMessage,
sizeof(szMessage) / sizeof(szMessage[0]));
+ CharToOemA (szMessage, szMessage);
+ fprintf (stderr, szMessage,
finddata.name);
}
}