bigsaycrashfix

This commit is contained in:
joonicks
2018-03-27 17:28:48 +02:00
parent d7121a6b1f
commit 7c5611931b
8 changed files with 99 additions and 61 deletions

View File

@@ -29,7 +29,17 @@ chars |
| |
| |
| |
| |
| |
| |
`--'
chars :
,--.
| |
`--'
,--.
| |
`--'
@@ -257,7 +267,8 @@ chars xX
,--. ,-.
\ \ / /
\ \/ /
) (
\ /
/ \
/ /\ \
/ / \ \
`-' `--'
@@ -271,3 +282,13 @@ chars yY
\ |
| |
|,--'
chars zZ
,--------.
\____ |
/ /
/ /
/ /
/ /___
/ |
`---------'

View File

@@ -761,6 +761,9 @@ void debug_core(void)
Spy *spy;
Strp *st;
Shit *shit;
#ifdef TOYBOX
BigC *bigc;
#endif /* TOYBOX */
#ifdef TRIVIA
TrivScore *triv;
#endif /* TRIVIA */
@@ -797,6 +800,7 @@ void debug_core(void)
debug("> servergrouplist\t"mx_pfmt"\n",(mx_ptr)servergrouplist);
for(sg=servergrouplist;sg;sg=sg->next)
{
memtouch(sg);
debug(" ; next\t\t"mx_pfmt"\n",(mx_ptr)sg->next);
debug(" ; servergroup\t\t%i\n",sg->servergroup);
debug(" ; name\t\t\"%s\"\n",nullbuf(sg->name));
@@ -1158,6 +1162,26 @@ void debug_core(void)
debug(" ; ---\n");
}
#endif /* SEEN */
#ifdef TOYBOX
if (fontname)
memtouch(fontname);
debug("; fontname*\t\t"mx_pfmt" { \"%s\" }\n",
(mx_ptr)fontname,nullstr(fontname));
debug("> fontlist\t\t"mx_pfmt"\n",(mx_ptr)fontlist);
for(bigc=fontlist;bigc;bigc=bigc->next)
{
memtouch(bigc);
debug(" ; width\t\t%i\n",bigc->width);
debug(" ; chars\t\t\"%s\"\n",bigc->chars);
debug(" > data\t\t"mx_pfmt"\n",(mx_ptr)bigc->data);
for(st=bigc->data;st;st=st->next)
{
memtouch(st);
debug(" ; Strp*\t\t"mx_pfmt" { "mx_pfmt", \"%s\" }\n",
(mx_ptr)st,(mx_ptr)st->next,st->p);
}
}
#endif /* TOYBOX */
#ifdef TRIVIA
debug("> scorelist\t\t"mx_pfmt"\n",(mx_ptr)scorelist);
for(triv=scorelist;triv;triv=triv->next)

View File

@@ -176,7 +176,7 @@ Strp *make_strp(Strp **pp, const char *string)
Strp *append_strp(Strp **pp, const char *string)
{
while((*pp)->next != NULL)
while((*pp) != NULL)
pp = &((*pp)->next);
make_strp(pp,string);
return(*pp);

View File

@@ -224,6 +224,13 @@ BEG Seen *seenlist MDEF(NULL);
#endif /* SEEN */
BEG char *fontname MDEF(NULL);
BEG BigC *fontlist MDEF(NULL);
BEG int charlines;
BEG int charheight;
BEG int spacewidth;
BEG int kerning;
#ifdef TRIVIA
BEG int triv_qdelay MDEF(30); /* proc var */
@@ -261,7 +268,6 @@ BEG int webport MDEF(0);
#endif /* WEB */
#ifndef I_HAVE_A_LEGITIMATE_NEED_FOR_MORE_THAN_4_BOTS
BEG int spawning_lamer MDEF(0);

View File

@@ -134,10 +134,10 @@ LS const Setting VarName[SIZE_VARS] =
{ STR_PROC, 100, 0, STRPROC(uptimehost), "UPHOST" }, /* send uptime packets to <uphost> */
{ STR_PROC, 100, 0, STRPROC(uptimenick), "UPNICK" }, /* send <upnick> as identifier instead of bots nick */
{ INT_PROC, 100, 0, INTPROC(uptimeport), "UPPORT", 65535 }, /* send packets to port <upport> */
#endif /* UPTIME */
#ifdef URLCAPTURE
{ INT_PROC, 100, 0, INTPROC(urlhistmax), "URLHIST", 100 }, /* max # of url's to keep in history */
#endif /* URLCAPTURE */
#endif /* UPTIME */
{ STR_GLOBAL, 90, 0, VNULL, "USERFILE" }, /* what file to load/save userlist from/to */
{ STR_GLOBAL, 90, 0, VNULL, "VIRTUAL", 0, (&var_resolve_host) }, /* visual host */
#ifdef WEB

View File

@@ -46,6 +46,30 @@ typedef union usercombo
} usercombo;
typedef struct OnMsg
{
const char *name;
void (*func)(char *, char *, char *, int);
ulong defaultaccess:8, /* defaultaccess */
dcc:1,
cc:1,
pass:1,
args:1,
nopub:1,
nocmd:1,
gaxs:1,
caxs:1,
redir:1,
lbuf:1,
cbang:1,
acchan:1,
supres:1; // -- 21 bits
char *cmdarg;
} OnMsg;
typedef unsigned char OnMsg_access;
#ifndef GENCMD_C
typedef struct ircLink
@@ -767,32 +791,6 @@ typedef struct TrivScore
} TrivScore;
#endif /* GENCMD_C */
typedef struct OnMsg
{
const char *name;
void (*func)(char *, char *, char *, int);
ulong defaultaccess:8, /* defaultaccess */
dcc:1,
cc:1,
pass:1,
args:1,
nopub:1,
nocmd:1,
gaxs:1,
caxs:1,
redir:1,
lbuf:1,
cbang:1,
acchan:1,
supres:1; // -- 21 bits
char *cmdarg;
} OnMsg;
typedef unsigned char OnMsg_access;
typedef struct dnsAuthority
{
struct dnsAuthority *next;
@@ -827,4 +825,16 @@ typedef struct dnsQuery
} dnsQuery;
typedef struct BigC
{
struct BigC *next;
int width;
Strp *data;
char chars[1];
} BigC;
#endif /* ifndef GENCMD_C */
#endif /* STRUCTS_H */

View File

@@ -32,30 +32,12 @@
#define BIGSAY_DEFAULTFONT "default"
#define FONT_EXTENSION ".bigchars"
typedef struct BigC
{
struct BigC *next;
int width;
Strp *data;
char chars[1];
} BigC;
LS char *fontname = NULL;
LS BigC *newchar;
LS BigC *fontlist = NULL;
LS int charlines;
LS int charheight;
LS int spacewidth;
LS int kerning;
LS BigC *orig_fontlist = NULL;
LS int orig_charlines;
LS int orig_charheight;
LS int orig_spacewidth;
LS int orig_kerning;
BigC *newchar;
BigC *orig_fontlist = NULL;
int orig_charlines;
int orig_charheight;
int orig_spacewidth;
int orig_kerning;
int read_bigcharset_callback(char *rest)
{
@@ -232,7 +214,7 @@ void do_bigsay(COMMAND_ARGS)
sp = bigc->data;
for(x=0;x<i;x++)
if (sp) sp = sp->next;
temp = sp->p;
temp = (sp) ? sp->p : "";
temp2 = tail;
while(*temp && tail < OEND)
*(tail++) = *(temp++);

View File

@@ -1249,11 +1249,6 @@ void do_user(COMMAND_ARGS)
to_user(from,"Problem adding %s (global mask)",tmpmask);
return;
}
if (matches("*@?*.?*",tmpmask))
{
to_user(from,"Problem adding %s (invalid mask)",tmpmask);
return;
}
#endif /* NEWBIE */
format_uh(tmpmask,FUH_USERHOST); // format_uh uses local temporary buffer but copies result back into tmpmask
/*