summaryrefslogtreecommitdiff
path: root/apps/filetypes.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/filetypes.c')
-rw-r--r--apps/filetypes.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/apps/filetypes.c b/apps/filetypes.c
index 530ab18683..3724f57a9b 100644
--- a/apps/filetypes.c
+++ b/apps/filetypes.c
@@ -531,17 +531,16 @@ int filetype_get_icon(int attr)
531 return filetypes[index].icon; 531 return filetypes[index].icon;
532} 532}
533 533
534char* filetype_get_plugin(const struct entry* file) 534char* filetype_get_plugin(const struct entry* file, char *buffer, size_t buffer_len)
535{ 535{
536 static char plugin_name[MAX_PATH];
537 int index = find_attr(file->attr); 536 int index = find_attr(file->attr);
538 if (index < 0) 537 if (index < 0 || !buffer)
539 return NULL; 538 return NULL;
540 if (filetypes[index].plugin == NULL) 539 if (filetypes[index].plugin == NULL)
541 return NULL; 540 return NULL;
542 snprintf(plugin_name, MAX_PATH, "%s/%s.%s", 541 snprintf(buffer, buffer_len, "%s/%s.%s",
543 PLUGIN_DIR, filetypes[index].plugin, ROCK_EXTENSION); 542 PLUGIN_DIR, filetypes[index].plugin, ROCK_EXTENSION);
544 return plugin_name; 543 return buffer;
545} 544}
546 545
547bool filetype_supported(int attr) 546bool filetype_supported(int attr)