Changeset 59 for sources/src/alias.cc


Ignore:
Timestamp:
Feb 6, 2017, 11:35:42 AM (7 years ago)
Author:
meunier
Message:
  • Fixed memory leaks
  • Fixed indentation in some files
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sources/src/alias.cc

    r52 r59  
    4141
    4242const char * alias () {
    43         static int i = 0;
    44         char * buf = new char[4];       
    45         buf[3] = '\0';
    46         buf[2] = 'a' + i % 26;
    47         buf[1] = 'a' + (i / 26) % 26;
    48         buf[0] = 'a' + ((i / 26) / 26) % 26;
    49         i++;   
    50         return buf;
     43    static int i = 0;
     44    char * buf = new char[4];
     45    buf[3] = '\0';
     46    buf[2] = 'a' + i % 26;
     47    buf[1] = 'a' + (i / 26) % 26;
     48    buf[0] = 'a' + ((i / 26) / 26) % 26;
     49    i++;
     50    return buf;
    5151}
    5252
Note: See TracChangeset for help on using the changeset viewer.