ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/font.c
(Generate patch)

Comparing ray/src/common/font.c (file contents):
Revision 2.23 by greg, Sat Nov 20 15:53:24 2021 UTC vs.
Revision 2.24 by greg, Sat Nov 20 22:39:01 2021 UTC

# Line 26 | Line 26 | getfont(                       /* return font fname */
26          char  *fname
27   )
28   {
29 +        char  embuf[512];
30          FILE  *fp;
31          char  *pathname, *err = NULL;
32          unsigned  wsum, hsum, ngly;
# Line 41 | Line 42 | getfont(                       /* return font fname */
42                  }
43                                                  /* load the font file */
44          if ((pathname = getpath(fname, getrlibpath(), R_OK)) == NULL) {
45 <                sprintf(errmsg, "cannot find font file \"%s\"\n", fname);
46 <                eputs(errmsg);
45 >                sprintf(embuf, "cannot find font file \"%s\"\n", fname);
46 >                eputs(embuf);
47                  return(NULL);
48          }
49          if ((fp = fopen(pathname, "r")) == NULL) {
50 <                sprintf(errmsg, "cannot open font file \"%s\"\n", pathname);
51 <                eputs(errmsg);
50 >                sprintf(embuf, "cannot open font file \"%s\"\n", pathname);
51 >                eputs(embuf);
52                  return(NULL);
53          }
54          f = (FONT *)calloc(1, sizeof(FONT));
# Line 113 | Line 114 | getfont(                       /* return font fname */
114          f->next = fontlist;
115          return(fontlist = f);
116   nonint:
117 <        sprintf(errmsg, "non-integer in font file \"%s\"\n", pathname);
118 <        eputs(errmsg);
117 >        sprintf(embuf, "non-integer in font file \"%s\"\n", pathname);
118 >        eputs(embuf);
119          fclose(fp);
120          return(NULL);
121   fonterr:
122 <        sprintf(errmsg, "%s character (%d) in font file \"%s\"\n",
122 >        sprintf(embuf, "%s character (%d) in font file \"%s\"\n",
123                          err, gn, pathname);
124 <        eputs(errmsg);
124 >        eputs(embuf);
125          fclose(fp);
126          return(NULL);
127   memerr:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines