]> granicus.if.org Git - graphviz/commitdiff
common: use a 'size_t' for 'fread' return, squashing a -Wconversion warning
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 21 May 2022 03:10:32 +0000 (20:10 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 23 May 2022 05:00:30 +0000 (22:00 -0700)
lib/common/psusershape.c

index abccefc746f293237ecdbf3a339db36a77f3fb74..53a4a91ff4e53a901b38be2f3a1ba90bceec47e2 100644 (file)
@@ -38,7 +38,6 @@ static usershape_t *user_init(const char *str)
     FILE *fp;
     struct stat statbuf;
     bool must_inline;
-    int rc;
     int lx, ly, ux, uy;
     usershape_t *us;
 
@@ -76,7 +75,7 @@ static usershape_t *user_init(const char *str)
        fstat(fileno(fp), &statbuf);
        contents = us->data = N_GNEW((size_t)statbuf.st_size + 1, char);
        fseek(fp, 0, SEEK_SET);
-       rc = fread(contents, (size_t)statbuf.st_size, 1, fp);
+       size_t rc = fread(contents, (size_t)statbuf.st_size, 1, fp);
        if (rc == 1) {
             contents[statbuf.st_size] = '\0';
             dtinsert(EPSF_contents, us);