well that file read wasnt safe.

SVN revision: 56132
This commit is contained in:
Carsten Haitzler 2011-01-15 15:34:39 +00:00
parent 1c5b26784c
commit 650c45f28a
1 changed files with 2 additions and 2 deletions

View File

@ -266,11 +266,11 @@ _load_file(const char *file)
FILE *f;
size_t size;
int alloc = 0, len = 0;
char *text = NULL, buf[PATH_MAX];
char *text = NULL, buf[16384 + 1];
f = fopen(file, "rb");
if (!f) return NULL;
while ((size = fread(buf, 1, sizeof(buf), f)))
while ((size = fread(buf, 1, sizeof(buf) - 1, f)))
{
char *tmp_text;
buf[size] = 0;