summaryrefslogtreecommitdiffstats
path: root/libmenu/menu_filesel.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmenu/menu_filesel.c')
-rw-r--r--libmenu/menu_filesel.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libmenu/menu_filesel.c b/libmenu/menu_filesel.c
index e6978d7fc2..06f6089806 100644
--- a/libmenu/menu_filesel.c
+++ b/libmenu/menu_filesel.c
@@ -193,7 +193,7 @@ static char **get_extensions(menu_t *menu){
if(!fp)
return NULL;
- extensions = (char **) malloc(sizeof(*extensions));
+ extensions = malloc(sizeof(*extensions));
*extensions = NULL;
while(fgets(ext,sizeof(ext),fp)) {
@@ -204,9 +204,9 @@ static char **get_extensions(menu_t *menu){
ext[s-1] = '\0';
s--;
}
- e = (char *) malloc(s+1);
- extensions = (char **) realloc(extensions, ++n * sizeof(*extensions));
- extensions = (char **) realloc(extensions, ++n * sizeof(*extensions));
+ e = malloc(s+1);
+ extensions = realloc(extensions, ++n * sizeof(*extensions));
+ extensions = realloc(extensions, ++n * sizeof(*extensions));
strcpy (e, ext);
for (l=extensions; *l; l++);
*l++ = e;
@@ -262,7 +262,7 @@ static int open_dir(menu_t* menu,char* args) {
}
}
- namelist = (char **) malloc(sizeof(char *));
+ namelist = malloc(sizeof(char *));
extensions = get_extensions(menu);
n=0;
@@ -290,7 +290,7 @@ static int open_dir(menu_t* menu,char* args) {
continue;
}
if(n%20 == 0){ // Get some more mem
- if((tp = (char **) realloc(namelist, (n+20) * sizeof (char *)))
+ if((tp = realloc(namelist, (n+20) * sizeof (char *)))
== NULL) {
mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_ReallocError, strerror(errno));
n--;
@@ -299,7 +299,7 @@ static int open_dir(menu_t* menu,char* args) {
namelist=tp;
}
- namelist[n] = (char *) malloc(strlen(dp->d_name) + 2);
+ namelist[n] = malloc(strlen(dp->d_name) + 2);
if(namelist[n] == NULL){
mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_MallocError, strerror(errno));
n--;