- int dlgsize = sizeof(DLGTEMPLATE) + (sizeof(WORD) * 3);
- DLGTEMPLATE* dlgTemplate = (DLGTEMPLATE*)malloc( dlgsize );
- memset (dlgTemplate, 0, dlgsize );
+
+ // we need 3 additional WORDs for dialog menu, class and title (as we
+ // don't use DS_SETFONT we don't need the fourth WORD for the font)
+ static const int dlgsize = sizeof(DLGTEMPLATE) + (sizeof(WORD) * 3);
+ DLGTEMPLATE *dlgTemplate = (DLGTEMPLATE *)malloc(dlgsize);
+ memset(dlgTemplate, 0, dlgsize);
+
+ // these values are arbitrary, they won't be used normally anyhow