pItem->m_iBadPwdCount = 0;
pItem->m_iHasLock = 1;
g_passwordManager.LockSource(strType,strLabel,false);
- g_settings.UpdateSource(strType, strLabel, "badpwdcount", itoa(pItem->m_iBadPwdCount, buffer, 10));
+ sprintf(buffer,"%i",pItem->m_iBadPwdCount);
+ g_settings.UpdateSource(strType, strLabel, "badpwdcount", buffer);
g_settings.SaveSources();
break;
}
// password entry failed
if (0 != g_guiSettings.GetInt("masterlock.maxretries"))
pItem->m_iBadPwdCount++;
- g_settings.UpdateSource(strType, strLabel, "badpwdcount", itoa(pItem->m_iBadPwdCount, buffer, 10));
+ sprintf(buffer,"%i",pItem->m_iBadPwdCount);
+ g_settings.UpdateSource(strType, strLabel, "badpwdcount", buffer);
g_settings.SaveSources();
break;
}
destinationBuffer = (LPWSTR)malloc(destinationBufferSize * sizeof(WCHAR));
}
+#ifdef _WIN32
int ret = MultiByteToWideChar(CodePage, dwFlags, lpMultiByteStr, cbMultiByte, destinationBuffer, destinationBufferSize);
+#else
+ int ret = 0;
+#endif
if (ret > 0)
{
destinationBuffer = (LPSTR)malloc(destinationBufferSize * sizeof(char));
}
+#ifdef _WIN32
int ret = WideCharToMultiByte(CodePage, dwFlags, lpWideCharStr, cchWideChar, destinationBuffer, destinationBufferSize, lpDefaultChar, lpUsedDefaultChar);
+#else
+ int ret = 0;
+#endif
if (ret > 0)
{
memcpy(var, envstring, value_start - envstring);
var[value_start - envstring] = 0;
- strupr(var);
+ char* temp = var;
+ while (*temp)
+ {
+ *temp = (char)toupper(*temp);
+ temp++;
+ }
strncpy(value, value_start + 1, size);
if (size)
if (iport)
{
char buffer[10];
+ sprintf(buffer,"%i",iport);
strHostAndPort += ':';
- strHostAndPort += itoa(iport, buffer, 10);
+ strHostAndPort += buffer;
}
// Get the file size of strFileName. If size is 0 or negative, file doesn't exist so exit.
if (url.HasPort())
{
char buffer[10];
+ sprintf(buffer,"%i",url.GetPort());
strHostAndPort += ':';
- strHostAndPort += itoa(url.GetPort(), buffer, 10);
+ strHostAndPort += buffer;
}
// No path given, list shows from ReplayGuide
if (pShares)
{
char buffer[10];
+ sprintf(buffer,"%i",pShares->size());
- if (eid!=-1)
- ejSetResult( eid, itoa(pShares->size(), buffer, 10));
+ if (eid!=-1)
+ ejSetResult( eid, buffer);
else
{
CStdString tmp;
- tmp.Format("%s", itoa(pShares->size(), buffer, 10));
+ tmp.Format("%i", pShares->size());
response="" + tmp;
}
#include <ctype.h>
#include <errno.h>
-
-/*
- ** The following two functions together make up an itoa()
- ** implementation. Function i2a() is a 'private' function
- ** called by the public itoa() function.
- **
- ** itoa() takes three arguments:
- ** 1) the integer to be converted,
- ** 2) a pointer to a character conversion buffer,
- ** 3) the radix for the conversion
- ** which can range between 2 and 36 inclusive
- ** range errors on the radix default it to base10
- */
-
-static char *i2a(unsigned i, char *a, unsigned r)
-{
- if (i/r > 0) a = i2a(i/r,a,r);
- *a = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"[i%r];
- return a+1;
-}
-
-char *itoa(int i, char *a, int r)
-{
- if ((r < 2) || (r > 36)) r = 10;
- if (i<0) {
- *a = '-';
- *i2a(-(unsigned)i,a+1,r) = 0;
- } else *i2a(i,a,r) = 0;
- return a;
-}
-
void OutputDebugString(LPCTSTR lpOuputString)
{
}
-void strlwr( char* string )
-{
- while ( *string )
- {
- *string = (char)tolower( *string );
- string++;
- }
-}
-
-void strupr( char* string )
-{
- while ( *string )
- {
- *string = (char)toupper( *string );
- string++;
- }
-}
-
LONGLONG Int32x32To64(LONG Multiplier, LONG Multiplicand)
{
LONGLONG result = Multiplier;
return result;
}
-int WideCharToMultiByte(
- UINT CodePage,
- DWORD dwFlags,
- LPCWSTR lpWideCharStr,
- int cchWideChar,
- LPSTR lpMultiByteStr,
- int cbMultiByte,
- LPCSTR lpDefaultChar,
- LPBOOL lpUsedDefaultChar
-) {
-
- // TODO: need to implement WideCharToMultiByte
- return 0;
-}
-
-int MultiByteToWideChar(
- UINT CodePage,
- DWORD dwFlags,
- LPCSTR lpMultiByteStr,
- int cbMultiByte,
- LPWSTR lpWideCharStr,
- int cchWideChar
-) {
-
- // TODO: need to implement MultiByteToWideChar
- return 0;
-
-}
-
DWORD GetLastError()
{
return errno;
*/
#include "PlatformDefs.h" // UINT DWORD LPCSTR LPSTR LPBOOL ...
-int WideCharToMultiByte(
- UINT CodePage,
- DWORD dwFlags,
- LPCWSTR lpWideCharStr,
- int cchWideChar,
- LPSTR lpMultiByteStr,
- int cbMultiByte,
- LPCSTR lpDefaultChar,
- LPBOOL lpUsedDefaultChar
-);
-
-int MultiByteToWideChar(
- UINT CodePage,
- DWORD dwFlags,
- LPCSTR lpMultiByteStr,
- int cbMultiByte,
- LPWSTR lpWideCharStr,
- int cchWideChar
-);
-
-
DWORD GetLastError();
VOID SetLastError(DWORD dwErrCode);
#define FILE_SHARE_WRITE 0x00000002
#define FILE_SHARE_DELETE 0x00000004
-
-// String
-char *itoa(int i, char *a, int r);
-void strlwr(char* string);
-void strupr(char* string);
-
// Audio stuff
typedef struct tWAVEFORMATEX
{