diff --git a/string/public/nsAReadableString.h b/string/public/nsAReadableString.h index 6bd72e921df..c21b7f7ed56 100644 --- a/string/public/nsAReadableString.h +++ b/string/public/nsAReadableString.h @@ -1230,8 +1230,8 @@ typedef basic_nsAReadableString nsAReadableCString; typedef basic_nsLiteralString nsLiteralString; typedef basic_nsLiteralString nsLiteralCString; -#define NS_LITERAL_STRING(s) nsLiteralString(s, sizeof(s)/sizeof(wchar_t)) -#define NS_LITERAL_CSTRING(s) nsLiteralCString(s, sizeof(s)) +#define NS_LITERAL_STRING(s) nsLiteralString(s, (sizeof(s)/sizeof(wchar_t))-1) +#define NS_LITERAL_CSTRING(s) nsLiteralCString(s, sizeof(s)-1) typedef basic_nsLiteralChar nsLiteralChar; typedef basic_nsLiteralChar nsLiteralPRUnichar; diff --git a/xpcom/ds/nsAReadableString.h b/xpcom/ds/nsAReadableString.h index 6bd72e921df..c21b7f7ed56 100644 --- a/xpcom/ds/nsAReadableString.h +++ b/xpcom/ds/nsAReadableString.h @@ -1230,8 +1230,8 @@ typedef basic_nsAReadableString nsAReadableCString; typedef basic_nsLiteralString nsLiteralString; typedef basic_nsLiteralString nsLiteralCString; -#define NS_LITERAL_STRING(s) nsLiteralString(s, sizeof(s)/sizeof(wchar_t)) -#define NS_LITERAL_CSTRING(s) nsLiteralCString(s, sizeof(s)) +#define NS_LITERAL_STRING(s) nsLiteralString(s, (sizeof(s)/sizeof(wchar_t))-1) +#define NS_LITERAL_CSTRING(s) nsLiteralCString(s, sizeof(s)-1) typedef basic_nsLiteralChar nsLiteralChar; typedef basic_nsLiteralChar nsLiteralPRUnichar; diff --git a/xpcom/string/public/nsAReadableString.h b/xpcom/string/public/nsAReadableString.h index 6bd72e921df..c21b7f7ed56 100644 --- a/xpcom/string/public/nsAReadableString.h +++ b/xpcom/string/public/nsAReadableString.h @@ -1230,8 +1230,8 @@ typedef basic_nsAReadableString nsAReadableCString; typedef basic_nsLiteralString nsLiteralString; typedef basic_nsLiteralString nsLiteralCString; -#define NS_LITERAL_STRING(s) nsLiteralString(s, sizeof(s)/sizeof(wchar_t)) -#define NS_LITERAL_CSTRING(s) nsLiteralCString(s, sizeof(s)) +#define NS_LITERAL_STRING(s) nsLiteralString(s, (sizeof(s)/sizeof(wchar_t))-1) +#define NS_LITERAL_CSTRING(s) nsLiteralCString(s, sizeof(s)-1) typedef basic_nsLiteralChar nsLiteralChar; typedef basic_nsLiteralChar nsLiteralPRUnichar;