From: Jeffrey Altman Date: Tue, 6 Apr 2004 23:26:37 +0000 (+0000) Subject: va_args-20040406 X-Git-Tag: openafs-devel-1_3_64~74 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=afb8a665406f68fd9996b8c9e6f444880d533aff;p=packages%2Fo%2Fopenafs.git va_args-20040406 Who at IBM was stupid enough to believe it is acceptable to pass a va_args variable into a function without initializing it with va_start()? Why would you ever bother to do otherwise? --- diff --git a/src/WINNT/talocale/tal_dialog.cpp b/src/WINNT/talocale/tal_dialog.cpp index f31bb29d5..7bf779ad7 100644 --- a/src/WINNT/talocale/tal_dialog.cpp +++ b/src/WINNT/talocale/tal_dialog.cpp @@ -76,7 +76,7 @@ int ModalDialogParam (int idd, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwI int cdecl Message (UINT type, LPCTSTR title, LPCTSTR text, LPCTSTR fmt, ...) { va_list arg; - if (fmt != NULL) + // if (fmt != NULL) va_start (arg, fmt); return vMessage (type, (LONG)title, (LONG)text, fmt, arg); } @@ -85,7 +85,7 @@ int cdecl Message (UINT type, LPCTSTR title, LPCTSTR text, LPCTSTR fmt, ...) int cdecl Message (UINT type, LPCTSTR title, int text, LPCTSTR fmt, ...) { va_list arg; - if (fmt != NULL) + // if (fmt != NULL) va_start (arg, fmt); return vMessage (type, (LONG)title, (LONG)text, fmt, arg); } @@ -94,7 +94,7 @@ int cdecl Message (UINT type, LPCTSTR title, int text, LPCTSTR fmt, ...) int cdecl Message (UINT type, int title, LPCTSTR text, LPCTSTR fmt, ...) { va_list arg; - if (fmt != NULL) + // if (fmt != NULL) va_start (arg, fmt); return vMessage (type, (LONG)title, (LONG)text, fmt, arg); } @@ -103,7 +103,7 @@ int cdecl Message (UINT type, int title, LPCTSTR text, LPCTSTR fmt, ...) int cdecl Message (UINT type, int title, int text, LPCTSTR fmt, ...) { va_list arg; - if (fmt != NULL) + // if (fmt != NULL) va_start (arg, fmt); return vMessage (type, (LONG)title, (LONG)text, fmt, arg); } diff --git a/src/WINNT/talocale/tal_string.cpp b/src/WINNT/talocale/tal_string.cpp index b1bb83367..bae31ee0b 100644 --- a/src/WINNT/talocale/tal_string.cpp +++ b/src/WINNT/talocale/tal_string.cpp @@ -181,7 +181,7 @@ void cdecl vFormatMultiString (LPTSTR *ppszTarget, BOOL fAddHead, LONG ids, LPCT void cdecl FormatMultiString (LPTSTR *ppszTarget, BOOL fAddHead, LPCTSTR pszTemplate, LPCTSTR pszFormat, ...) { va_list arg; - if (pszFormat != NULL) + //if (pszFormat != NULL) va_start (arg, pszFormat); vFormatMultiString (ppszTarget, fAddHead, (LONG)pszTemplate, pszFormat, arg); } @@ -189,7 +189,7 @@ void cdecl FormatMultiString (LPTSTR *ppszTarget, BOOL fAddHead, LPCTSTR pszTemp void cdecl FormatMultiString (LPTSTR *ppszTarget, BOOL fAddHead, int idsTemplate, LPCTSTR pszFormat, ...) { va_list arg; - if (pszFormat != NULL) + //if (pszFormat != NULL) va_start (arg, pszFormat); vFormatMultiString (ppszTarget, fAddHead, (LONG)idsTemplate, pszFormat, arg); } @@ -212,7 +212,7 @@ void cdecl vFormatMultiString (LPTSTR *ppszTarget, BOOL fAddHead, int idsTemplat LPTSTR cdecl FormatString (LPCTSTR psz, LPCTSTR pszFmt, ...) { va_list arg; - if (pszFmt != NULL) + //if (pszFmt != NULL) va_start (arg, pszFmt); return vFormatString ((LONG)psz, pszFmt, arg); } @@ -220,7 +220,7 @@ LPTSTR cdecl FormatString (LPCTSTR psz, LPCTSTR pszFmt, ...) LPTSTR cdecl FormatString (int ids, LPCTSTR pszFmt, ...) { va_list arg; - if (pszFmt != NULL) + //if (pszFmt != NULL) va_start (arg, pszFmt); return vFormatString ((LONG)ids, pszFmt, arg); }