]> granicus.if.org Git - graphviz/commitdiff
unify some fopen code across Windows and non-Windows
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 18 Feb 2021 04:53:54 +0000 (20:53 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 24 Feb 2021 15:48:10 +0000 (07:48 -0800)
The mode flag 'b' is a no-op on POSIX, so we can use the same code everywhere.

lib/gvc/gvusershape.c

index 6bb1a3768ee673fcc2043e71c6ccef76e6febf99..3fe3ebdc6a7f1620f802d654347a0feda9ffa6d1 100644 (file)
@@ -623,11 +623,7 @@ boolean gvusershape_file_access(usershape_t *us)
            agerr(AGWARN, "Filename \"%s\" is unsafe\n", us->name);
            return FALSE;
        }
-#ifndef _WIN32
-       us->f = fopen(fn, "r");
-#else
        us->f = fopen(fn, "rb");
-#endif
        if (us->f == NULL) {
            agerr(AGWARN, "%s while opening %s\n", strerror(errno), fn);
            return FALSE;