This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Little Problem

Old posts that have not been replied to for several years.
Locked
M
MtX

Little Problem

Post by MtX »

Hi, i have little problem with my code

Code: Select all

static int addban_msg (char *nick, char *host, char *handle, char *chan, char *text)
{
  Context;
  memberlist *m;
  struct chanset_t *c;
  c = findchan_by_dname (chan);
  char *p, h[100];
  p = strchr (host, '@');
  char *bannick = getnumword (text, 1);
  if (!sprintf (h, "*!*%s@*", bannick))
    return (0);
  if (m = isowner (handle))
  {
//just for test  dprintf (DP_SERVER, "privmsg %s :%s %s\r\n", chan, bannick, h);
      u_addban (c, bannick, botname, "pub", now+86400, 0);
  }
  return (0);
}
#0 0x40301a76 in addban_msg (nick=0x81a2c00 "LinuxLoader",
host=0x81a0730 "~Slackware@127.0.0.1", handle=0x819d998 "*",
chan=0x819daa8 "#liaskovec", text=0x81a2ce8 "fs", u=0x402aad30)
at ../matrix.mod/matrix.c:73
This is in my core file.
When i type !akick sdfs eggdrop give segmentation fault.
Any ideas ?
User avatar
BarkerJr
Op
Posts: 104
Joined: Sun Mar 30, 2003 1:25 am
Contact:

Post by BarkerJr »

What's getnumword?
M
MtX

getnomword

Post by MtX »

getnomword is my function, to get words after bind.
!akick sdf sdfsdf
will get sdf
Can you help me with this problem ?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Try using a few more "Context" lines and use the normal eggdrop debugging abilties.

Another note, why not use the normal Eggdrop newsplit functions provided to get words of on the input.

newsplit (from the top of my head) will return the first word from the input text, and update the input point to point to the start of the next word.

So multiple calls to newsplit return a new word each time.
M
MtX

Post by MtX »

I try this, and again my eggdrop shutdown.
static int addban_msg (char *nick, char *host, char *handle, char *chan, char *text)
{
Context;
struct chanset_t *c;
c = findchan_by_dname(chan);
u_addban (c, "mtx!*@*", botname, "pub", 0L, 0);
return 0;
}
Locked