X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=backend%2Fdvi%2Fmdvi-lib%2Fdviread.c;h=97b7b844103f961364ad32685e0a6a89091be020;hb=5e064e2f91b064c8d7b01b97b3ebb146eb40de6c;hp=d696d8a6f26248d94bf435bb491d79362c43bddd;hpb=14def5e0c1c11cee1523e10c72df74f4cf5e451d;p=evince.git diff --git a/backend/dvi/mdvi-lib/dviread.c b/backend/dvi/mdvi-lib/dviread.c index d696d8a6..97b7b844 100644 --- a/backend/dvi/mdvi-lib/dviread.c +++ b/backend/dvi/mdvi-lib/dviread.c @@ -13,7 +13,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include @@ -359,7 +359,7 @@ static int sort_down(const void *p1, const void *p2) } static int sort_random(const void *p1, const void *p2) { - return (random() % 1) ? -1 : 1; + return (rand() % 1) ? -1 : 1; } static int sort_dvi_up(const void *p1, const void *p2) { @@ -684,7 +684,7 @@ DviContext *mdvi_init_context(DviParams *par, DviPageSpec *spec, const char *fil perror(file); return NULL; } - p = fopen(filename, "r"); + p = fopen(filename, "rb"); if(p == NULL) { perror(file); mdvi_free(filename); @@ -1008,7 +1008,7 @@ int mdvi_dopage(DviContext *dvi, int pageno) again: if(dvi->in == NULL) { /* try reopening the file */ - dvi->in = fopen(dvi->filename, "r"); + dvi->in = fopen(dvi->filename, "rb"); if(dvi->in == NULL) { mdvi_warning(_("%s: could not reopen file (%s)\n"), dvi->filename,