@@ -221,25 +221,25 @@ static const char *GetLocalCode()
/** FYI: This is not thread-safe.
* convert between locales, which from and which to is set in the calling
* functions OTTD2FS() and FS2OTTD(). You should NOT use this function directly
* NOTE: iconv was added in OSX 10.3. 10.2.x will still have the invalid char
* issues. There aren't any easy fix for this */
static const char *convert_tofrom_fs(iconv_t convd, const char *name)
{
static char buf[1024];
/* Work around buggy iconv implementation where inbuf is wrongly typed as
* non-const. Correct implementation is at
* http://www.opengroup.org/onlinepubs/007908799/xsh/iconv.html */
#if defined (__GLIBC__) || defined (__GNU_LIBRARY__)
#ifdef HAVE_BROKEN_ICONV
char *inbuf = (char*)name;
#else
const char *inbuf = name;
#endif
char *outbuf = buf;
size_t outlen = sizeof(buf) - 1;
size_t inlen = strlen(name);
ttd_strlcpy(outbuf, name, sizeof(buf));
iconv(convd, NULL, NULL, NULL, NULL);