src/config.c
changeset 58 500a5ea7fcb8
parent 51 5d9aed3948a6
child 62 2d6419d6d4ed
equal deleted inserted replaced
57:ca4e10daa1c9 58:500a5ea7fcb8
    44 
    44 
    45     /*
    45     /*
    46      * We can easily provide default values ...
    46      * We can easily provide default values ...
    47      */
    47      */
    48     uc->nick = uc->pass = uc->server = uc->channel = uc->topic = NULL;
    48     uc->nick = uc->pass = uc->server = uc->channel = uc->topic = NULL;
    49     uc->port = 6667;
    49     uc->port = "6667";
    50 
    50 
    51     while (!feof (f)) {
    51     while (!feof (f)) {
    52         if (fgets (buffer, sizeof (buffer), f) == NULL)
    52         if (fgets (buffer, sizeof (buffer), f) == NULL)
    53             break;
    53             break;
    54         token = buffer;
    54         token = buffer;
    89             case SERVER:
    89             case SERVER:
    90                 uc->server = compat_strdup (line[map]);
    90                 uc->server = compat_strdup (line[map]);
    91                 free (line[map]);
    91                 free (line[map]);
    92                 break;
    92                 break;
    93             case PORT:
    93             case PORT:
    94                 uc->port = atoi (line[map]);
    94                 uc->port = compat_strdup (line[map]);
    95                 free (line[map]);
    95                 free (line[map]);
    96                 break;
    96                 break;
    97             case CHANNEL:
    97             case CHANNEL:
    98                 uc->channel = compat_strdup (line[map]);
    98                 uc->channel = compat_strdup (line[map]);
    99                 free (line[map]);
    99                 free (line[map]);