Browse Source

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

mingodad 12 years ago
parent
commit
ce40516e96
1 changed files with 2 additions and 2 deletions
  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){
 	SQ_FUNC_VARS(v);
 	GET_SQ_FPDF();
-	SQBlob *blob = NULL;
+	SQBlob *blob = NULL;
 	if(_top_ > 1) {
         SQObjectType ptype = sq_gettype(v, 2);
         if(ptype == OT_INSTANCE){
@@ -588,7 +588,7 @@ static SQRESULT sq_glue_Output(HSQUIRRELVM v){
             if(!blob || !blob->IsValid())
                 return sq_throwerror(v,_SC("the blob is invalid"));
             std::string str = self->Output(0, 'S');
-            blob->Resize(str.size());
+            blob->SetLen(str.size());
             memcpy(blob->GetBuf(), str.c_str(), str.size());
             return 0;
         }