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.22 by greg, Fri Nov 19 22:51:31 2021 UTC vs.
Revision 2.23 by greg, Sat Nov 20 15:53:24 2021 UTC

# Line 11 | Line 11 | static const char      RCSid[] = "$Id$";
11  
12   #include "paths.h"
13   #include "rtio.h"
14 + #include "rterror.h"
15   #include "font.h"
16  
17   #define galloc(nv)      (GLYPH *)malloc(sizeof(GLYPH)+2*sizeof(GORD)*(nv))
# Line 40 | Line 41 | getfont(                       /* return font fname */
41                  }
42                                                  /* load the font file */
43          if ((pathname = getpath(fname, getrlibpath(), R_OK)) == NULL) {
44 <                fprintf(stderr, "cannot find font file \"%s\"\n", fname);
44 >                sprintf(errmsg, "cannot find font file \"%s\"\n", fname);
45 >                eputs(errmsg);
46                  return(NULL);
47          }
48          if ((fp = fopen(pathname, "r")) == NULL) {
49 <                fprintf(stderr, "cannot open font file \"%s\"\n", pathname);
49 >                sprintf(errmsg, "cannot open font file \"%s\"\n", pathname);
50 >                eputs(errmsg);
51                  return(NULL);
52          }
53          f = (FONT *)calloc(1, sizeof(FONT));
# Line 110 | Line 113 | getfont(                       /* return font fname */
113          f->next = fontlist;
114          return(fontlist = f);
115   nonint:
116 <        fprintf(stderr, "non-integer in font file \"%s\"\n", pathname);
116 >        sprintf(errmsg, "non-integer in font file \"%s\"\n", pathname);
117 >        eputs(errmsg);
118          fclose(fp);
119          return(NULL);
120   fonterr:
121 <        fprintf(stderr, "%s character (%d) in font file \"%s\"\n",
121 >        sprintf(errmsg, "%s character (%d) in font file \"%s\"\n",
122                          err, gn, pathname);
123 +        eputs(errmsg);
124          fclose(fp);
125          return(NULL);
126   memerr:
127 <        fprintf(stderr, "out of memory in getfont()\n");
127 >        eputs("out of memory in getfont()\n");
128          fclose(fp);
129          return(NULL);
130   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines