Browse Source

Moved macro to header file and added a check to the value returned by sq_size.

mingodad 13 years ago
parent
commit
8107e1ac97
1 changed files with 2 additions and 3 deletions
  1. 2 3
      squirrel/sqbaselib.cpp

+ 2 - 3
squirrel/sqbaselib.cpp

@@ -291,9 +291,7 @@ static SQInteger base_callee(HSQUIRRELVM v)
 	}
 	}
 	return sq_throwerror(v,_SC("no closure in the calls stack"));
 	return sq_throwerror(v,_SC("no closure in the calls stack"));
 }
 }
-
-/* macro to `unsign' a character */
-#define uchar(c)    ((unsigned SQChar)(c))
+
 
 
 static SQInteger base_str_from_chars (HSQUIRRELVM v) {
 static SQInteger base_str_from_chars (HSQUIRRELVM v) {
   SQ_FUNC_VARS_NO_TOP(v);
   SQ_FUNC_VARS_NO_TOP(v);
@@ -889,6 +887,7 @@ static SQInteger array_concat0 (HSQUIRRELVM v, int allowAll) {
       const SQChar *value;
       const SQChar *value;
       sq_getstring(v, -1, &value);
       sq_getstring(v, -1, &value);
       SQInteger value_size = sq_getsize(v, -1);
       SQInteger value_size = sq_getsize(v, -1);
+      if(value_size < 0) return SQ_ERROR;
       blob.Write((void*)value, value_size);
       blob.Write((void*)value, value_size);
       if(i != opt_last) blob.Write((void*)sep, sep_size);
       if(i != opt_last) blob.Write((void*)sep, sep_size);
       sq_settop(v, _top_);
       sq_settop(v, _top_);