break;\r
case MAT_SHM: \r
fstat( shm_fd, &buf); \r
- if( ( shmptr = mmap(0, buf.st_size, PROT_READ, MAP_SHARED, shm_fd, 0) ) == (void *) (-1) ) //MJP BUG? \r
+ if( ( shmptr = mmap(0, buf.st_size, PROT_READ, MAP_SHARED, shm_fd, 0) ) == MAP_FAILED ) \r
{\r
exit(EXIT_FAILURE);\r
} \r
if(shm_fd == -1)\r
{\r
Log_fatal( "SHM_API: Open failed:%s\n", strerror(errno));\r
- exit(1);\r
+ exit(EXIT_FAILURE);\r
} \r
\r
if( ftruncate( shm_fd, shmtotal_size ) == -1 )\r
{\r
Log_fatal( "SHM_API: ftruncate : %s\n", strerror(errno)); \r
- exit(1);\r
+ exit(EXIT_FAILURE);\r
}\r
\r
- shmptr = mmap(0, shmtotal_size, PROT_READ | PROT_WRITE, MAP_SHARED, shm_fd, 0);\r
- if (shmptr == (void *) -1) \r
+ shmptr = mmap( 0, shmtotal_size, PROT_READ | PROT_WRITE, MAP_SHARED, shm_fd, 0 );\r
+ if (shmptr == MAP_FAILED) \r
{\r
Log_fatal( "SHM_API: mmap failed : %s\n", strerror(errno));\r
- exit(1);\r
+ exit(EXIT_FAILURE);\r
} \r
\r
memset( shmptr, 0, shmtotal_size );\r
channel_t *channel = client_itr->channel;\r
\r
strncpy( shmptr->client[cc].username, client_itr->username, 120 );\r
- strncpy( shmptr->client[cc].ipaddress, Util_clientAddressToString( client_itr ), 45 );\r
+ strncpy( shmptr->client[cc].ipaddress, Util_clientAddressToString( client_itr ), INET6_ADDRSTRLEN - 1 );\r
strncpy( shmptr->client[cc].channel, channel->name, 120 );\r
\r
strncpy( shmptr->client[cc].os, client_itr->os, 120 );\r