]> www.fi.muni.cz Git - evince.git/blobdiff - backend/dvi/mdvi-lib/dviread.c
[gimpcellrenderertoggle] Port to gtk 3
[evince.git] / backend / dvi / mdvi-lib / dviread.c
index d696d8a6f26248d94bf435bb491d79362c43bddd..97b7b844103f961364ad32685e0a6a89091be020 100644 (file)
@@ -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 <config.h>
@@ -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,