Просмотр исходного кода

Fix check input value in clish_pargv__get_parg()

Serj Kalichev 9 лет назад
Родитель
Сommit
394da9e79e
1 измененных файлов с 2 добавлено и 2 удалено
  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];
 }