瀏覽代碼

Fix a mistake on setting a new size to blob that will return the generated pdf.

mingodad 12 年之前
父節點
當前提交
ce40516e96
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      SquiLu-ext/sq_fpdf.cpp

+ 2 - 2
SquiLu-ext/sq_fpdf.cpp

@@ -579,7 +579,7 @@ static SQRESULT sq_glue_Open(HSQUIRRELVM v){
 static SQRESULT sq_glue_Output(HSQUIRRELVM v){
 static SQRESULT sq_glue_Output(HSQUIRRELVM v){
 	SQ_FUNC_VARS(v);
 	SQ_FUNC_VARS(v);
 	GET_SQ_FPDF();
 	GET_SQ_FPDF();
-	SQBlob *blob = NULL;
+	SQBlob *blob = NULL;
 	if(_top_ > 1) {
 	if(_top_ > 1) {
         SQObjectType ptype = sq_gettype(v, 2);
         SQObjectType ptype = sq_gettype(v, 2);
         if(ptype == OT_INSTANCE){
         if(ptype == OT_INSTANCE){
@@ -588,7 +588,7 @@ static SQRESULT sq_glue_Output(HSQUIRRELVM v){
             if(!blob || !blob->IsValid())
             if(!blob || !blob->IsValid())
                 return sq_throwerror(v,_SC("the blob is invalid"));
                 return sq_throwerror(v,_SC("the blob is invalid"));
             std::string str = self->Output(0, 'S');
             std::string str = self->Output(0, 'S');
-            blob->Resize(str.size());
+            blob->SetLen(str.size());
             memcpy(blob->GetBuf(), str.c_str(), str.size());
             memcpy(blob->GetBuf(), str.c_str(), str.size());
             return 0;
             return 0;
         }
         }