IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39339


Ignore:
Timestamp:
Feb 10, 2016, 10:30:45 AM (10 years ago)
Author:
eugene
Message:

do not collide in strcpy operation

Location:
trunk/Ohana/src/libkapa
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libkapa/rotfont/alphabet.h

    r5854 r39339  
    6161};
    6262
    63 int Nallfonts;
    64 FontSet *AllFonts;
    65 RotFont *activefont;
    66 double activescale;
    67 
    68 char currentname[64];
    69 int  currentsize;
     63// int Nallfonts;
     64// FontSet *AllFonts;
     65// RotFont *activefont;
     66// double activescale;
     67//
     68// char currentname[64];
     69// int  currentsize;
  • trunk/Ohana/src/libkapa/src/RotFont.c

    r29537 r39339  
    3030  currentfont = RotFonts[DEFFONT].font;
    3131  currentscale = 1.0;
    32   strcpy (currentname, RotFonts[DEFFONT].name);
     32  strncpy (currentname, RotFonts[DEFFONT].name, 63); currentname[63] = 0;
    3333  currentsize = RotFonts[DEFFONT].size;
    3434}
     
    6565    currentscale = (double) size / RotFonts[match].size;
    6666    currentsize = size;
    67     strcpy (currentname, name);
     67    if (name != currentname) {
     68      strncpy (currentname, name, 63); currentname[63] = 0;
     69    }
    6870    return (TRUE);
    6971  } else {
Note: See TracChangeset for help on using the changeset viewer.