X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=prvm_execprogram.h;h=9620daca72176be7c4c45717970c2e2114561a81;hp=8c6b0e47eb3e66b9c6bb183073f6c8c53717845b;hb=26678e90426687f151e496d496a8cc4957e0fcba;hpb=bbb9c294521e969fad9c5079af1531c92c241cae diff --git a/prvm_execprogram.h b/prvm_execprogram.h index 8c6b0e47..9620daca 100644 --- a/prvm_execprogram.h +++ b/prvm_execprogram.h @@ -187,7 +187,7 @@ case OP_STOREP_FLD: // integers case OP_STOREP_S: case OP_STOREP_FNC: // pointers - if (OPB->_int < 0 || OPB->_int + 1 > prog->entityfieldsarea) + if ((unsigned int)OPB->_int >= (unsigned int)prog->entityfieldsarea) { PreError(); prog->error_cmd("%s attempted to write to an out of bounds edict (%i)", prog->name, (int)OPB->_int); @@ -220,7 +220,7 @@ break; case OP_ADDRESS: - if (OPA->edict < 0 || OPA->edict >= prog->max_edicts) + if ((unsigned int)OPA->edict >= (unsigned int)prog->max_edicts) { PreError(); prog->error_cmd("%s Progs attempted to address an out of bounds edict number", prog->name); @@ -249,7 +249,7 @@ case OP_LOAD_ENT: case OP_LOAD_S: case OP_LOAD_FNC: - if (OPA->edict < 0 || OPA->edict >= prog->max_edicts) + if ((unsigned int)OPA->edict >= (unsigned int)prog->max_edicts) { PreError(); prog->error_cmd("%s Progs attempted to read an out of bounds edict number", prog->name); @@ -266,7 +266,7 @@ break; case OP_LOAD_V: - if (OPA->edict < 0 || OPA->edict >= prog->max_edicts) + if ((unsigned int)OPA->edict >= (unsigned int)prog->max_edicts) { PreError(); prog->error_cmd("%s Progs attempted to read an out of bounds edict number", prog->name);