Replace manual/error-prone/hard-to-verify arraysize calculations with safe FX_ArraySi...
[pdfium.git] / core / include / fxcrt / fx_string.h
index 47e8ecd..44c6fc5 100644 (file)
@@ -597,7 +597,7 @@ private:
     }
 };
 typedef const CFX_WideStringC& FX_WSTR;
-#define FX_WSTRC(wstr) CFX_WideStringC(wstr, sizeof(wstr) / sizeof(FX_WCHAR) - 1)
+#define FX_WSTRC(wstr) CFX_WideStringC(wstr, FX_ArraySize(wstr) - 1)
 struct CFX_StringDataW {
 
     long               m_nRefs;