Browse Source

Apply fixes from squirrel

mingodad 9 years ago
parent
commit
c2c396e8d6
1 changed files with 4 additions and 1 deletions
  1. 4 1
      SquiLu/sqstdlib/sqstdstring.cpp

+ 4 - 1
SquiLu/sqstdlib/sqstdstring.cpp

@@ -76,7 +76,10 @@ SQRESULT sqstd_format(HSQUIRRELVM v,SQInteger nformatstringidx,SQInteger *outlen
 	const SQChar *format;
 	SQChar *dest;
 	SQChar fmt[MAX_FORMAT_LEN];
-	sq_getstring(v,nformatstringidx,&format);
+	SQRESULT res = sq_getstring(v,nformatstringidx,&format);
+	if (SQ_FAILED(res)) {
+        return res; // propagate the error
+    }
 	SQInteger format_size = sq_getsize(v,nformatstringidx);
 	SQInteger allocated = (format_size+2)*sizeof(SQChar);
 	dest = sq_getscratchpad(v,allocated);