no more garbage in text file previews

ticket #1601


SVN revision: 79322
This commit is contained in:
Mike Blumenkrantz 2012-11-15 08:20:48 +00:00
parent 0ebb47b562
commit 97e91c2e9b
1 changed files with 2 additions and 2 deletions

View File

@ -807,14 +807,14 @@ static void
_e_wid_fprev_preview_txt_read(void *data __UNUSED__, Ecore_Thread *eth)
{
char *text;
char buf[FILEPREVIEW_TEXT_PREVIEW_SIZE];
char buf[FILEPREVIEW_TEXT_PREVIEW_SIZE + 1] = {0};
FILE *f;
text = ecore_thread_global_data_find("fprev_file");
if (!text) return;
f = fopen(text, "r");
if (!f) return;
fread(buf, sizeof(char), sizeof(buf), f);
fread(buf, sizeof(char), FILEPREVIEW_TEXT_PREVIEW_SIZE, f);
ecore_thread_feedback(eth, evas_textblock_text_utf8_to_markup(NULL, buf));
fclose(f);
}