44 *
55 * Portions Copyright (c) 2002-2009, PostgreSQL Global Development Group
66 *
7- * $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.44 2009/01/0913:03:55 mha Exp $
7+ * $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.45 2009/01/0914:07:00 mha Exp $
88 *
99 *-----------------------------------------------------------------------
1010 */
@@ -476,7 +476,7 @@ strftime_win32(char *dst, size_t dstlen, const wchar_t *format, const struct tm
476476
477477encoding = GetDatabaseEncoding ();
478478
479- len = wcsftime (wbuf ,sizeof ( wbuf ) ,format ,tm );
479+ len = wcsftime (wbuf ,MAX_L10N_DATA ,format ,tm );
480480if (len == 0 )
481481/* strftime call failed - return 0 with the contents of dst unspecified */
482482return 0 ;
@@ -492,7 +492,7 @@ strftime_win32(char *dst, size_t dstlen, const wchar_t *format, const struct tm
492492char * convstr = pg_do_encoding_conversion (dst ,len ,PG_UTF8 ,encoding );
493493if (dst != convstr )
494494{
495- StrNCpy (dst ,convstr ,dstlen );
495+ strlcpy (dst ,convstr ,dstlen );
496496len = strlen (dst );
497497}
498498}