Cleanup bits_to_lastlog_level a little bit. Use strlcat rather than strmcat.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@405 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
@@ -87,9 +87,9 @@ unsigned long BX_set_lastlog_msg_level(unsigned long level)
|
|||||||
*/
|
*/
|
||||||
char * bits_to_lastlog_level(unsigned long level)
|
char * bits_to_lastlog_level(unsigned long level)
|
||||||
{
|
{
|
||||||
static char buffer[481]; /* this *should* be enough for this */
|
int i;
|
||||||
int i;
|
unsigned long p;
|
||||||
unsigned long p;
|
static char buffer[512];
|
||||||
|
|
||||||
if (level == LOG_ALL)
|
if (level == LOG_ALL)
|
||||||
strcpy(buffer, "ALL");
|
strcpy(buffer, "ALL");
|
||||||
@@ -97,14 +97,13 @@ unsigned long p;
|
|||||||
strcpy(buffer, "NONE");
|
strcpy(buffer, "NONE");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*buffer = '\0';
|
for (*buffer = i = 0, p = 1; i < NUMBER_OF_LEVELS; i++, p <<= 1)
|
||||||
for (i = 0, p = 1; i < NUMBER_OF_LEVELS; i++, p <<= 1)
|
|
||||||
{
|
{
|
||||||
if (level & p)
|
if (level & p)
|
||||||
{
|
{
|
||||||
if (*buffer)
|
if (*buffer)
|
||||||
strmcat(buffer, space, 480);
|
strlcat(buffer, space, sizeof buffer);
|
||||||
strmcat(buffer, levels[i],480);
|
strlcat(buffer, levels[i], sizeof buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user