*messagep = js_DeflateString(cx, reportp->ucmessage, out - reportp->ucmessage);
*messagep = js_DeflateString(cx, reportp->ucmessage, (size_t)(out - reportp->ucmessage));
js_ExpandErrorArguments(JSContext *cx, JSErrorCallback callback,			void *userRef, const uintN errorNumber,			char **messagep, JSErrorReport *reportp,                        JSBool charArgs, va_list ap){    const JSErrorFormatString *fmtData;    int i;    int argCount;    *messagep = NULL;    if (callback) {	fmtData = (*callback)(userRef, "Mountain View", errorNumber);	if (fmtData != NULL) {            int totalArgsLength = 0;            int argLengths[10]; /* only {0} thru {9} supported */	    argCount = fmtData->argCount;            JS_ASSERT(argCount <= 10);	    if (argCount > 0) {		/*                 * Gather the arguments into an array, and accumulate                 * their sizes. We allocate 1 more than necessary and                  * null it out to act as the caboose when we free the                 * pointers later.		 */		reportp->messageArgs                        = JS_malloc(cx, sizeof(jschar *) * (argCount + 1));		if (!reportp->messageArgs)		    return JS_FALSE;                reportp->messageArgs[argCount] = NULL;                for (i = 0; i < argCount; i++) {                    if (charArgs) {                        char *charArg = va_arg(ap, char *);		        reportp->messageArgs[i]                             = js_InflateString(cx, charArg, strlen(charArg));                    }                    else		        reportp->messageArgs[i] = va_arg(ap, jschar *);                    argLengths[i] = js_strlen(reportp->messageArgs[i]);                    totalArgsLength += argLengths[i];                }                /* NULL-terminate for easy copying. */                reportp->messageArgs[i] = NULL; 	    }	    /*	     * Parse the error format, substituting the argument X	     * for {X} in the format.	     */	    if (argCount > 0) {		if (fmtData->format) {		    const char *fmt;                    const jschar *arg;		    jschar *out;		    int expandedArgs = 0;		    int expandedLength			= strlen(fmtData->format)			  - (3 * argCount) /* exclude the {n} */                          + totalArgsLength;            /* Note - the above calculation assumes that each argument             *   is used once and only once in the expansion !!!             */		    reportp->ucmessage = out                         = JS_malloc(cx, (expandedLength + 1) * sizeof(jschar));		    if (!out) {			if (reportp->messageArgs) {			    JS_free(cx, (void *)reportp->messageArgs);			    reportp->messageArgs = NULL;			}			return JS_FALSE;		    }		    fmt = fmtData->format;		    while (*fmt) {			if (*fmt == '{') {	/* balance} */			    if (isdigit(fmt[1])) {				int d = JS7_UNDEC(fmt[1]);				JS_ASSERT(expandedArgs < argCount);				arg = reportp->messageArgs[d];				js_strncpy(out, arg, argLengths[d]);				out += argLengths[d];				fmt += 3;				expandedArgs++;				continue;			    }			}                        /*                         * is this kosher?                         */			*out++ = (unsigned char)(*fmt++);		    }		    JS_ASSERT(expandedArgs == argCount);		    *out = 0;                    *messagep = js_DeflateString(cx, reportp->ucmessage,                                                    out - reportp->ucmessage);		}            } else { /* 0 arguments, the format string                        (if it exists) is the entire message */                if (fmtData->format) {		    *messagep = JS_strdup(cx, fmtData->format);                    reportp->ucmessage                         = js_InflateString(cx, *messagep, strlen(*messagep));                }	    }	}    }    if (*messagep == NULL) {	/* where's the right place for this ??? */	const char *defaultErrorMessage	    = "No error message available for error number %d";	size_t nbytes = strlen(defaultErrorMessage) + 16;	*messagep = (char *)JS_malloc(cx, nbytes);	JS_snprintf(*messagep, nbytes, defaultErrorMessage, errorNumber);    }    return JS_TRUE;}