msvc6 compilation fixes

fix buffer over(under?)flow in calc_sep()

svn path=/trunk/; revision=18549
This commit is contained in:
Royce Mitchell III 2005-10-18 04:15:55 +00:00
parent a658088fed
commit 67d9667289

View file

@ -470,7 +470,7 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
int len; int len;
TCHAR *s; TCHAR *s;
HGLOBAL hGlobalMemory; HGLOBAL hGlobalMemory;
PSTR pGlobalMemory; LPTSTR pGlobalMemory;
if (!(len = _tcslen(calc.display))) if (!(len = _tcslen(calc.display)))
return 0; return 0;
@ -506,10 +506,10 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
case TEXT('\x16'): // Ctrl+V Paste case TEXT('\x16'): // Ctrl+V Paste
{ {
TCHAR *s; TCHAR *s;
int c; TCHAR c;
int cmd = 0; int cmd = 0;
int size = 0; size_t size = 0;
int i = 0; size_t i = 0;
HGLOBAL hGlobalMemory; HGLOBAL hGlobalMemory;
LPTSTR pGlobalMemory; LPTSTR pGlobalMemory;
@ -3082,7 +3082,7 @@ TCHAR *calc_sep(TCHAR *s)
r[i++] = c; r[i++] = c;
if (x++ % 3 == 0) if (x++ % 3 == 0)
r[i++] = TEXT(','); r[i++] = TEXT(',');
if (n == -1) if (n == 0)
break; break;
} }