Changeset 17 for vtcross/trunk

Show
Ignore:
Timestamp:
10/13/08 15:52:30 (16 years ago)
Author:
jgaeddert
Message:

using strcpy instead of iteration

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • vtcross/trunk/src/cbr.c

    r16 r17  
    2323    cbr _cbr = (cbr) malloc(sizeof(struct cbr_s)); 
    2424 
    25     // copy filename 
    26     unsigned int i=0; 
    27     do { 
    28         _cbr->filename[i] = _filename[i]; 
    29     } while (_filename[i++] != '\0'); 
    30  
    31     // copy tablename 
    32     i=0; 
    33     do { 
    34         _cbr->tablename[i] = _tablename[i]; 
    35     } while (_tablename[i++] != '\0'); 
     25    // copy filename, tablename 
     26    strcpy(_cbr->filename, _filename); 
     27    strcpy(_cbr->tablename, _tablename); 
    3628 
    3729    _cbr->db = NULL; 
     
    4234    strcat(_cbr->command, _tablename); 
    4335    strcat(_cbr->command, "("); 
     36    unsigned int i; 
    4437    for (i=0; i<_len; i++) { 
    4538        strcat(_cbr->command, _cols[i]);