rem: if (write(fd, ds.string, ds.length) < 0) {
add: if (write(fd, ds.string, (size_t)ds.length) < 0) {
context: AdpDebug(NsInterp *itPtr, char *ptr, int len, int nscript){    int code, fd;    Tcl_Interp *interp = itPtr->interp;    int level = itPtr->adp.debugLevel;    char *file = Tcl_GetString(itPtr->adp.objv[0]);    char buf[10], debugfile[255];    Ns_DString ds;    code = TCL_ERROR;    Ns_DStringInit(&ds);    sprintf(buf, "%d", level);    Ns_DStringVarAppend(&ds,	"#\n"	"# level: ", buf, "\n", NULL);    sprintf(buf, "%d", nscript);    Ns_DStringVarAppend(&ds,	"# chunk: ", buf, "\n"	"# file:  ", file, "\n"	"#\n\n", NULL);    Ns_DStringNAppend(&ds, ptr, len);    sprintf(debugfile, P_tmpdir "/adp%d.%d.XXXXXX", level, nscript);    if (mktemp(debugfile) == NULL) {	Tcl_SetResult(interp, "could not create adp debug file", TCL_STATIC);    } else {	fd = open(debugfile, O_WRONLY|O_TRUNC|O_CREAT, 0644);	if (fd < 0) {	    Tcl_AppendResult(interp, "could not create adp debug file \"",		debugfile, "\": ", Tcl_PosixError(interp), NULL);	} else {	    if (write(fd, ds.string, ds.length) < 0) {		Tcl_AppendResult(interp, "write to \"", debugfile,		    "\" failed: ", Tcl_PosixError(interp), NULL);	    } else {		Ns_DStringTrunc(&ds, 0);		Ns_DStringVarAppend(&ds, "source ", debugfile, NULL);		code = Tcl_EvalEx(interp, ds.string, ds.length, 0);	    }	    close(fd);	    unlink(debugfile);	}    }    Ns_DStringFree(&ds);    return code;}