Bug 191712 nsDateTimeFormatUnix returns an uninitialized value in an error case

r=smontagu sr=alecf
This commit is contained in:
timeless%mozdev.org 2003-02-23 13:38:46 +00:00
Родитель 5d62c94573
Коммит fc3928b29e
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -194,7 +194,6 @@ nsresult nsDateTimeFormatUnix::FormatTMTime(nsILocale* locale,
const struct tm* tmTime, const struct tm* tmTime,
nsString& stringOut) nsString& stringOut)
{ {
NS_ENSURE_TRUE(mDecoder, NS_ERROR_NOT_INITIALIZED);
#define NSDATETIME_FORMAT_BUFFER_LEN 80 #define NSDATETIME_FORMAT_BUFFER_LEN 80
char strOut[NSDATETIME_FORMAT_BUFFER_LEN*2]; // buffer for date and time char strOut[NSDATETIME_FORMAT_BUFFER_LEN*2]; // buffer for date and time
char fmtD[NSDATETIME_FORMAT_BUFFER_LEN], fmtT[NSDATETIME_FORMAT_BUFFER_LEN]; char fmtD[NSDATETIME_FORMAT_BUFFER_LEN], fmtT[NSDATETIME_FORMAT_BUFFER_LEN];
@ -203,6 +202,7 @@ nsresult nsDateTimeFormatUnix::FormatTMTime(nsILocale* locale,
// set up locale data // set up locale data
(void) Initialize(locale); (void) Initialize(locale);
NS_ENSURE_TRUE(mDecoder, NS_ERROR_NOT_INITIALIZED);
// set date format // set date format
switch (dateFormatSelector) { switch (dateFormatSelector) {