Revision: 58838 http://sourceforge.net/p/brlcad/code/58838 Author: starseeker Date: 2013-12-05 22:08:09 +0000 (Thu, 05 Dec 2013) Log Message: ----------- Avoid issue with const DEFAULT_FONT
Modified Paths: -------------- brlcad/trunk/src/libbu/vfont.c Modified: brlcad/trunk/src/libbu/vfont.c =================================================================== --- brlcad/trunk/src/libbu/vfont.c 2013-12-05 21:54:27 UTC (rev 58837) +++ brlcad/trunk/src/libbu/vfont.c 2013-12-05 22:08:09 UTC (rev 58838) @@ -58,15 +58,15 @@ unsigned char dispatch[10*256]; /* 256 10-byte structs */ uint16_t magic; int size; + const char *const_font; - if (font == NULL) - font = DEFAULT_FONT; + const_font = (font == NULL) ? DEFAULT_FONT : (const char *)font; /* Open the file and read in the header information. */ if ((fp = fopen(font, "rb")) == NULL) { - snprintf(fname, FONTNAMESZ, "%s/%s", (char *)bu_brlcad_data("vfont", 0), font); + snprintf(fname, FONTNAMESZ, "%s/%s", (char *)bu_brlcad_data("vfont", 0), const_font); if ((fp = fopen(fname, "rb")) == NULL) { - snprintf(fname, FONTNAMESZ, "%s/%s", FONTDIR2, font); + snprintf(fname, FONTNAMESZ, "%s/%s", FONTDIR2, const_font); if ((fp = fopen(fname, "rb")) == NULL) { return VFONT_NULL; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Sponsored by Intel(R) XDK Develop, test and display web and hybrid apps with a single code base. Download it for free now! http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits