Skip to content

Commit

Permalink
cosmetic code changes/fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdelnero committed Nov 25, 2019
1 parent 39a2999 commit 2d5e4c4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
20 changes: 10 additions & 10 deletions src/fs_handles_db.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,16 @@ DIR * fs_find_first_file(char *folder, filefoundinfo* fileinfo)
}

closedir(dir);
dir = 0;
dir = NULL;

}

closedir(dir);
dir = 0;
dir = NULL;
}
else
{
dir = 0;
dir = NULL;
}

return dir;
Expand Down Expand Up @@ -299,7 +299,7 @@ fs_entry * search_entry(fs_handles_db * db, filefoundinfo *fileinfo, uint32_t pa
entry_list = entry_list->next;
}

return 0;
return NULL;
}

fs_entry * alloc_entry(fs_handles_db * db, filefoundinfo *fileinfo, uint32_t parent, uint32_t storage_id)
Expand Down Expand Up @@ -490,7 +490,7 @@ fs_entry * get_next_child_handle(fs_handles_db * db)

db->search_entry = 0x00000000;

return 0;
return NULL;
}

fs_entry * get_entry_by_handle(fs_handles_db * db, uint32_t handle)
Expand Down Expand Up @@ -527,7 +527,7 @@ fs_entry * get_entry_by_handle_and_storageid(fs_handles_db * db, uint32_t handle
entry_list = entry_list->next;
}

return 0;
return NULL;
}

char * build_full_path(fs_handles_db * db,char * root_path,fs_entry * entry)
Expand All @@ -537,7 +537,7 @@ char * build_full_path(fs_handles_db * db,char * root_path,fs_entry * entry)
char * full_path;
int full_path_offset;

full_path = 0;
full_path = NULL;

curentry = entry;
totallen = 0;
Expand All @@ -552,7 +552,7 @@ char * build_full_path(fs_handles_db * db,char * root_path,fs_entry * entry)
}
else
{
curentry = 0;
curentry = NULL;
}

}while( curentry );
Expand Down Expand Up @@ -587,7 +587,7 @@ char * build_full_path(fs_handles_db * db,char * root_path,fs_entry * entry)
}
else
{
curentry = 0;
curentry = NULL;
}
}while(curentry);

Expand Down Expand Up @@ -661,5 +661,5 @@ fs_entry * get_entry_by_wd( fs_handles_db * db, int watch_descriptor )
entry_list = entry_list->next;
}

return 0;
return NULL;
}
13 changes: 7 additions & 6 deletions src/mtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ int parse_incomming_dataset(mtp_ctx * ctx,void * datain,int size,uint32_t * newh
{
if(entry->flags & ENTRY_IS_DIR)
{
tmp_path = 0;
tmp_path = NULL;

parent_folder = build_full_path(ctx->fs_db, mtp_get_storage_root(ctx, entry->storage_id), entry);

Expand Down Expand Up @@ -370,8 +370,8 @@ int parse_incomming_dataset(mtp_ctx * ctx,void * datain,int size,uint32_t * newh
{
parent_folder = build_full_path(ctx->fs_db, mtp_get_storage_root(ctx, entry->storage_id), entry);

tmp_path = 0;
entry = 0;
tmp_path = NULL;
entry = NULL;

if(parent_folder)
{
Expand Down Expand Up @@ -871,9 +871,10 @@ int process_in_packet(mtp_ctx * ctx,MTP_PACKET_HEADER * mtp_packet_hdr, int raws
break;
}

tmp_str = 0;
full_path = 0;
entry = 0;
tmp_str = NULL;
full_path = NULL;
entry = NULL;

if(parent_handle && parent_handle!=0xFFFFFFFF)
{
entry = get_entry_by_handle(ctx->fs_db, parent_handle);
Expand Down
1 change: 0 additions & 1 deletion src/mtp_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ static int exec_cmd(mtp_ctx * context, char * command,char * line)
i++;
}


return 0;
}

Expand Down

0 comments on commit 2d5e4c4

Please sign in to comment.