Merge pull request #42 from qarmin/fixes

Fix some Cppcheck findings
This commit is contained in:
Marek Kraus 2020-10-29 17:17:03 +01:00 committed by GitHub
commit 91cd02fe2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -2349,7 +2349,7 @@ GLB_GPIO_INT_CONTROL_Type GLB_Get_GPIO_IntCtlMod(GLB_GPIO_Type gpioPin)
*******************************************************************************/
BL_Err_Type GLB_GPIO_INT0_Callback_Install(GLB_GPIO_Type gpioPin,intCallback_Type* cbFun)
{
if(gpioPin<32){
if(gpioPin<GLB_GPIO_INT0_NUM){
glbGpioInt0CbfArra[gpioPin] = cbFun;
}

View File

@ -572,7 +572,7 @@ static aos_dirent_t *romfs_readdir(file_t *fp, aos_dir_t *dir)
return NULL;
} else {
while (1) {
if ((dp->dir_cur_addr >= dp->dir_end_addr) || (dp->dir_cur_addr >= dp->dir_end_addr)){
if ((dp->dir_cur_addr >= dp->dir_end_addr) || (dp->dir_cur_addr < dp->dir_start_addr)){
ROMFS_DUBUG("cur_addr = %p\r\n", dp->dir_cur_addr);
return NULL;
}

View File

@ -272,7 +272,7 @@ void blog_port_output(const char *log, size_t size) {
size_t blog_strcpy(size_t cur_len, char *dst, const char *src) {
const char *src_old = src;
if ((!src) || (!src)) {
if ((!dst) || (!src)) {
__blog_printf("assert.\r\n");
return 0;
}