diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-25 19:29:14 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-25 19:29:14 +0000 |
commit | 53c425e61c058fa586040dda56728906025989e8 (patch) | |
tree | ad3ab92630460a74344862adb98b5e2277711a4f /psgeom.c | |
parent | 1952210eda8c22ca34704894290e9a39ee96ecb4 (diff) |
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_903_specialxf86-4_3_99_902xf86-4_3_99_901xf86-4_3_99_16xf86-012804-2330
Diffstat (limited to 'psgeom.c')
-rw-r--r-- | psgeom.c | 28 |
1 files changed, 19 insertions, 9 deletions
@@ -24,7 +24,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/xkbprint/psgeom.c,v 1.5 2001/07/25 15:05:25 dawes Exp $ */ +/* $XFree86: xc/programs/xkbprint/psgeom.c,v 1.6 2003/04/22 14:01:49 pascal Exp $ */ #define XK_TECHNICAL #define XK_PUBLISHING @@ -807,7 +807,7 @@ int p,baseline; PSSetFont(out,state,FONT_LATIN1,14,False); } if (state->args->label==LABEL_SYMBOLS) { - char buf[40],*sName= NULL; + char buf[40],*sName= NULL, *lbuf; Atom sAtom; if (state->args->nLabelGroups==1) @@ -827,12 +827,17 @@ int p,baseline; if (sName==NULL) sName= "(unknown)"; - sprintf(buf,"Layout: %s",sName); - fprintf(out,"kbx kbdscalewidth 0 (%s) centeroffset pop add\n",buf); + lbuf = uAlloc(10+strlen(sName)); + if (!lbuf) { + uFatalError("Can't allocate memory for string\n"); + } + sprintf(lbuf,"Layout: %s",sName); + fprintf(out,"kbx kbdscalewidth 0 (%s) centeroffset pop add\n",lbuf); fprintf(out," kby kbdscaleheight add %d add\n",baseline); fprintf(out," moveto\n"); - fprintf(out,"1 -1 scale (%s) show 1 -1 scale\n",buf); + fprintf(out,"1 -1 scale (%s) show 1 -1 scale\n",lbuf); baseline+= 16; + free(lbuf); } if (name!=NULL) { fprintf(out,"kbx kbdscalewidth 0 (%s) centeroffset pop add\n",name); @@ -842,7 +847,7 @@ int p,baseline; baseline+= 16; } if (state->args->label==LABEL_KEYCODE) { - char buf[40],*sName= NULL; + char *sName= NULL, *lbuf; Atom sAtom; if (xkb->names!=NULL) sAtom= xkb->names->keycodes; @@ -852,12 +857,17 @@ int p,baseline; if (sName==NULL) sName= "(unknown)"; - sprintf(buf,"Keycodes: %s",sName); - fprintf(out,"kbx kbdscalewidth 0 (%s) centeroffset pop add\n",buf); + lbuf = uAlloc(12+strlen(sName)); + if (!lbuf) { + uFatalError("Can't allocate memory for string\n"); + } + sprintf(lbuf,"Keycodes: %s",sName); + fprintf(out,"kbx kbdscalewidth 0 (%s) centeroffset pop add\n",lbuf); fprintf(out," kby kbdscaleheight add %d add\n",baseline); fprintf(out," moveto\n"); - fprintf(out,"1 -1 scale (%s) show 1 -1 scale\n",buf); + fprintf(out,"1 -1 scale (%s) show 1 -1 scale\n",lbuf); baseline+= 16; + free(lbuf); } if (state->args->copies>1) { for (p=1;p<state->args->copies;p++) |