ole32: Avoid a possible null dereference.

This commit is contained in:
Bruno Jesus 2014-11-13 22:13:40 -02:00 committed by Alexandre Julliard
parent bab4c36d47
commit 959ca6ac02

View file

@ -210,13 +210,11 @@ UINT ole_private_data_clipboard_format = 0;
static UINT wine_marshal_clipboard_format;
static inline char *dump_fmtetc(FORMATETC *fmt)
static inline const char *dump_fmtetc(FORMATETC *fmt)
{
static char buf[100];
snprintf(buf, sizeof(buf), "cf %04x ptd %p aspect %x lindex %d tymed %x",
fmt->cfFormat, fmt->ptd, fmt->dwAspect, fmt->lindex, fmt->tymed);
return buf;
if (!fmt) return "(null)";
return wine_dbg_sprintf("cf %04x ptd %p aspect %x lindex %d tymed %x",
fmt->cfFormat, fmt->ptd, fmt->dwAspect, fmt->lindex, fmt->tymed);
}
/*---------------------------------------------------------------------*