Browse Source

Fix check input value in clish_pargv__get_parg()

Serj Kalichev 9 years ago
parent
commit
40a8d0e410
1 changed files with 2 additions and 2 deletions
  1. 2 2
      clish/pargv/pargv.c

+ 2 - 2
clish/pargv/pargv.c

@@ -112,11 +112,11 @@ unsigned clish_pargv__get_count(clish_pargv_t * this)
 }
 
 /*--------------------------------------------------------- */
-clish_parg_t *clish_pargv__get_parg(clish_pargv_t * this, unsigned index)
+clish_parg_t *clish_pargv__get_parg(clish_pargv_t * this, unsigned int index)
 {
 	if (!this)
 		return NULL;
-	if (index > this->pargc)
+	if (index >= this->pargc)
 		return NULL;
 	return this->pargv[index];
 }