fix colors.c

This commit is contained in:
Green Sky 2023-11-22 23:04:15 +01:00
parent a72a4d97b3
commit 9da166ea34
No known key found for this signature in database

View File

@ -13,6 +13,9 @@
*/ */
#include <ctype.h> #include <ctype.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#define LIBIRC_COLORPARSER_BOLD (1<<1) #define LIBIRC_COLORPARSER_BOLD (1<<1)
#define LIBIRC_COLORPARSER_UNDERLINE (1<<2) #define LIBIRC_COLORPARSER_UNDERLINE (1<<2)
@ -123,11 +126,11 @@ static char * libirc_colorparser_irc2code (const char * source, int strip)
const char *p; const char *p;
int current_bg = 0; int current_bg = 0;
/* /*
* There will be two passes. First pass calculates the total length of * There will be two passes. First pass calculates the total length of
* the destination string. The second pass allocates memory for the string, * the destination string. The second pass allocates memory for the string,
* and fills it. * and fills it.
*/ */
while ( destline == 0 ) // destline will be set after the 2nd pass while ( destline == 0 ) // destline will be set after the 2nd pass
{ {
if ( destlen > 0 ) if ( destlen > 0 )
@ -252,11 +255,11 @@ char * irc_color_convert_to_mirc (const char * source)
char * destline = 0, *d = 0; char * destline = 0, *d = 0;
const char *p1, *p2, *cur; const char *p1, *p2, *cur;
/* /*
* There will be two passes. First pass calculates the total length of * There will be two passes. First pass calculates the total length of
* the destination string. The second pass allocates memory for the string, * the destination string. The second pass allocates memory for the string,
* and fills it. * and fills it.
*/ */
while ( destline == 0 ) // destline will be set after the 2nd pass while ( destline == 0 ) // destline will be set after the 2nd pass
{ {
if ( destlen > 0 ) if ( destlen > 0 )