Index: document.c =================================================================== --- document.c (revision 1564) +++ document.c (working copy) @@ -630,7 +630,7 @@ } // use strlen to check for null chars - filedata->len = strlen(filedata->data); + filedata->len = st.st_size; /* check whether the size of the loaded data is equal to the size of the file in the filesystem */ if (filedata->len != (gsize) st.st_size)