Changeset 0519a87 in code for icb.c


Ignore:
Timestamp:
Jan 18, 2015, 8:46:13 PM (10 years ago)
Author:
Mike Belopuhov <mike@…>
Branches:
master
Children:
cb7c494
Parents:
8f5ba64
git-author:
Mike Belopuhov <mike@…> (01/18/15 16:05:42)
git-committer:
Mike Belopuhov <mike@…> (01/18/15 20:46:13)
Message:

param.h and MAXHOSTNAMELEN cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icb.c

    r8f5ba64 r0519a87  
    1515 */
    1616
    17 #include <sys/param.h>
     17#include <sys/types.h>
    1818#include <sys/queue.h>
     19#include <netdb.h>
    1920#include <stdarg.h>
    2021#include <stdio.h>
     
    3132
    3233extern int creategroups;
    33 extern char srvname[MAXHOSTNAMELEN];
     34extern char srvname[NI_MAXHOST];
    3435
    3536void   icb_command(struct icb_session *, char *, char *);
     
    5051                (void)gethostname(srvname, sizeof srvname);
    5152        /*
    52          * MAXHOSTNAMELEN is usually greater than what we
     53         * NI_MAXHOST is usually greater than what we
    5354         * can actually send, hence truncation:
    5455         */
     
    185186        if (client && strlen(client) > 0)
    186187                icb_vis(is->client, client, sizeof is->client, VIS_SP);
     188        else
     189                strlcpy(is->client, is->nick, sizeof is->client);
    187190        is->group = ig;
    188191        is->login = time(NULL);
Note: See TracChangeset for help on using the changeset viewer.