Fix a few warnings.
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3458 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -263,13 +263,15 @@ utf8StringPos (const unsigned char *pStr, UniChar ch)
|
|||||||
// Safe version of strcpy(), somewhat analogous to strncpy()
|
// Safe version of strcpy(), somewhat analogous to strncpy()
|
||||||
// except it guarantees a 0-term when size > 0
|
// except it guarantees a 0-term when size > 0
|
||||||
// when size == 0, returns NULL
|
// when size == 0, returns NULL
|
||||||
|
// BUG: this may result in the last character being only partially in the
|
||||||
|
// buffer
|
||||||
unsigned char *
|
unsigned char *
|
||||||
utf8StringCopy (unsigned char *dst, size_t size, const unsigned char *src)
|
utf8StringCopy (unsigned char *dst, size_t size, const unsigned char *src)
|
||||||
{
|
{
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
strncpy (dst, src, size);
|
strncpy ((char *) dst, (char *) src, size);
|
||||||
dst[size - 1] = '\0';
|
dst[size - 1] = '\0';
|
||||||
|
|
||||||
return dst;
|
return dst;
|
||||||
@@ -317,7 +319,7 @@ utf8StringCompare (const unsigned char *str1, const unsigned char *str2)
|
|||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
// this will do for now
|
// this will do for now
|
||||||
return strcmp (str1, str2);
|
return strcmp ((char *) str1, (char *) str2);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user