Changeset 11

Show
Ignore:
Timestamp:
03/25/07 09:42:43 (2 years ago)
Author:
takkaria
Message:

Replace all uses of strcat() with my_strcat().

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/birth.c

    r1 r11  
    14151415 
    14161416                                /* Hack -- add a fake slash */ 
    1417                                 strcat(inp, "/"); 
     1417                                my_strcat(inp, "/", sizeof(inp)); 
    14181418 
    14191419                                /* Hack -- look for the "slash" */ 
  • trunk/src/load.c

    r1 r11  
    21192119                /* Extract name of lock file */ 
    21202120                my_strcpy(temp, savefile, sizeof(temp)); 
    2121                 strcat(temp, ".lok"); 
     2121                my_strcat(temp, ".lok", sizeof(temp)); 
    21222122 
    21232123                /* Grab permissions */ 
     
    23332333                /* Extract name of lock file */ 
    23342334                my_strcpy(temp, savefile, sizeof(temp)); 
    2335                 strcat(temp, ".lok"); 
     2335                my_strcat(temp, ".lok", sizeof(temp)); 
    23362336 
    23372337                /* Grab permissions */ 
  • trunk/src/main-ami.c

    r1 r11  
    537537static int read_enhanced_palette ( void ); 
    538538static int read_normal_palette(void); 
    539 static char *handle_font(struct term_data *td, char *fontname); 
     539static char *handle_font(struct term_data *td, char *fontname, size_t fontname_size); 
    540540ULONG trans ( byte g ); 
    541541int create_menus ( void ); 
     
    909909                { 
    910910                        /* Make sure the font name ends with .font */ 
    911                         if ( !strstr( ts->fontname, ".font" )) 
    912                                 strcat( ts->fontname, ".font" ); 
     911                        if (!strstr(ts->fontname, ".font")) 
     912                                my_strcat(ts->fontname, ".font", sizeof(ts->fontname)); 
    913913 
    914914                        /* Set font attributes */ 
     
    22042204                                strcpy(fontname,param); 
    22052205 
    2206                         s = handle_font(td, fontname); 
     2206                        s = handle_font(td, fontname, sizeof(fontname)); 
    22072207                        if (s) 
    22082208                                puts(s); 
     
    22282228} 
    22292229 
    2230 static char *handle_font(struct term_data *td, char *fontname
     2230static char *handle_font(struct term_data *td, char *fontname, size_t fontname_size
    22312231{ 
    22322232        static char error[128]; 
     
    22582258                return NULL; 
    22592259        } 
    2260                else 
     2260        else 
    22612261        { 
    22622262                /* Find font name/size delimiter */ 
     
    22812281 
    22822282                /* Make sure the font name ends with .font */ 
    2283                 if ( !strstr( fontname, ".font" )) 
    2284                         strcat( fontname, ".font" ); 
     2283                if (!strstr(fontname, ".font")) 
     2284                        my_strcat(fontname, ".font", fontname_size); 
    22852285 
    22862286                /* Set font attributes */ 
     
    32003200 
    32013201                                        request_font(fontname); 
    3202                                         handle_font(td, fontname); 
     3202                                        handle_font(td, fontname, sizeof(fontname)); 
    32033203 
    32043204                                        SetFont(td->rp, td->font); 
     
    49294929                c = temp2[strlen(temp2) - 1]; 
    49304930                if (c != '/' && c != ':') 
    4931                         strcat(temp2,"/"); 
     4931                        my_strcat(temp2, "/", sizeof(temp2)); 
    49324932                strcpy(name, temp2); 
    49334933                return; 
     
    50995099 
    51005100        /* Append a "maximum level" */ 
    5101         if (mdun > cdun) strcat(temp, format(" (Max %d)", mdun)); 
     5101        if (mdun > cdun) my_strcat(temp, format(" (Max %d)", mdun), sizeof(temp)); 
    51025102 
    51035103        /* Dump the info */ 
  • trunk/src/main-lfb.c

    r4 r11  
    922922 
    923923                                path_build(path, sizeof(path), ANGBAND_DIR_XTRA_FONT, buf); 
    924                                 strcat(path, ".bmp"); 
     924                                my_strcat(path, ".bmp", sizeof(path)); 
    925925 
    926926                                /* 
     
    931931                                { 
    932932                                        path_build(path, sizeof(path), ANGBAND_DIR_XTRA_FONT, fb_font); 
    933                                         strcat(path, ".bmp"); 
     933                                        my_strcat(path, ".bmp", sizeof(path)); 
    934934 
    935935                                        if (fb_read_font(path, FALSE)) exit_game_panic(); 
     
    943943                                        { 
    944944                                                path_build(path, sizeof(path), ANGBAND_DIR_XTRA_FONT, fb_font); 
    945                                                 strcat(path, ".bmp"); 
     945                                                my_strcat(path, ".bmp", sizeof(path)); 
    946946 
    947947                                                if (fb_read_font(path, FALSE)) exit_game_panic(); 
     
    15341534        /* Load the font */ 
    15351535        path_build(path, sizeof(path), ANGBAND_DIR_XTRA_FONT, fb_font); 
    1536         strcat(path, ".bmp"); 
     1536        my_strcat(path, ".bmp", sizeof(path)); 
    15371537        fb_read_font(path, TRUE); 
    15381538 
  • trunk/src/object1.c

    r1 r11  
    233233 
    234234                                /* Add a space */ 
    235                                 strcat(buf, " "); 
     235                                my_strcat(buf, " ", sizeof(buf)); 
    236236 
    237237                                /* Add the word */ 
     
    30323032 
    30333033                        /* Indicate ability to "view" */ 
    3034                         if (!p_ptr->command_see) strcat(out_val, " * to see,"); 
     3034                        if (!p_ptr->command_see) my_strcat(out_val, " * to see,", sizeof(out_val)); 
    30353035 
    30363036                        /* Indicate legality of "toggle" */ 
    3037                         if (use_equip) strcat(out_val, " / for Equip,"); 
     3037                        if (use_equip) my_strcat(out_val, " / for Equip,", sizeof(out_val)); 
    30383038 
    30393039                        /* Indicate legality of the "floor" */ 
    3040                         if (allow_floor) strcat(out_val, " - for floor,"); 
     3040                        if (allow_floor) my_strcat(out_val, " - for floor,", sizeof(out_val)); 
    30413041                } 
    30423042 
     
    30623062 
    30633063                        /* Indicate ability to "view" */ 
    3064                         if (!p_ptr->command_see) strcat(out_val, " * to see,"); 
     3064                        if (!p_ptr->command_see) my_strcat(out_val, " * to see,", sizeof(out_val)); 
    30653065 
    30663066                        /* Indicate legality of "toggle" */ 
    3067                         if (use_inven) strcat(out_val, " / for Inven,"); 
     3067                        if (use_inven) my_strcat(out_val, " / for Inven,", sizeof(out_val)); 
    30683068 
    30693069                        /* Indicate legality of the "floor" */ 
    3070                         if (allow_floor) strcat(out_val, " - for floor,"); 
     3070                        if (allow_floor) my_strcat(out_val, " - for floor,", sizeof(out_val)); 
    30713071                } 
    30723072 
     
    30913091 
    30923092                        /* Indicate ability to "view" */ 
    3093                         if (!p_ptr->command_see) strcat(out_val, " * to see,"); 
     3093                        if (!p_ptr->command_see) my_strcat(out_val, " * to see,", sizeof(out_val)); 
    30943094 
    30953095                        /* Append */ 
    3096                         if (use_inven) strcat(out_val, " / for Inven,"); 
     3096                        if (use_inven) my_strcat(out_val, " / for Inven,", sizeof(out_val)); 
    30973097 
    30983098                        /* Append */ 
    3099                         else if (use_equip) strcat(out_val, " / for Equip,"); 
     3099                        else if (use_equip) my_strcat(out_val, " / for Equip,", sizeof(out_val)); 
    31003100                } 
    31013101 
    31023102                /* Finish the prompt */ 
    3103                 strcat(out_val, " ESC"); 
     3103                my_strcat(out_val, " ESC", sizeof(out_val)); 
    31043104 
    31053105                /* Build the prompt */ 
  • trunk/src/save.c

    r1 r11  
    16801680        /* New savefile */ 
    16811681        my_strcpy(safe, savefile, sizeof(safe)); 
    1682         strcat(safe, ".new"); 
     1682        my_strcat(safe, ".new", sizeof(safe)); 
    16831683 
    16841684        /* Grab permissions */ 
     
    16981698                /* Old savefile */ 
    16991699                my_strcpy(temp, savefile, sizeof(temp)); 
    1700                 strcat(temp, ".old"); 
     1700                my_strcat(temp, ".old", sizeof(temp)); 
    17011701 
    17021702                /* Grab permissions */ 
     
    17251725                /* Lock on savefile */ 
    17261726                my_strcpy(temp, savefile, sizeof(temp)); 
    1727                 strcat(temp, ".lok"); 
     1727                my_strcat(temp, ".lok", sizeof(temp)); 
    17281728 
    17291729                /* Grab permissions */