<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/9176" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2005-03-14T08:05:55-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/9176</id>

		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-03-14T08:05:55-04:00</updated>

		<published>2005-03-14T08:05:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47621#p47621</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47621#p47621"/>
		<title type="html"><![CDATA[Help with Pointers - Need to tweak a little C function]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47621#p47621"><![CDATA[
I fixed the code with another technique. The source code compiles fine without an error or a single warning. But sometimes in between while displaying access lists services crashes for no reason.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"> <br><br>Never encountered this type of error before. Showed the code to alot of people logicially it looks fine and works fine but sometimes it doesn't. I will check the services.core file generated by gdb.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Mon Mar 14, 2005 8:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Galadhrim]]></name></author>
		<updated>2005-03-14T06:49:28-04:00</updated>

		<published>2005-03-14T06:49:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47616#p47616</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47616#p47616"/>
		<title type="html"><![CDATA[Help with Pointers - Need to tweak a little C function]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47616#p47616"><![CDATA[
alright. took me 30 secs to find the errors (maybe cause im used to getting errors :p )<br><br>first of all:<div class="codebox"><p>Code: </p><pre><code>NickCore *nc; ChanAccess *access = &amp;ci-&gt;access[index]; NickAlias *na = findnick(nc-&gt;display); </code></pre></div>both <em class="text-italics">nc</em> and <em class="text-italics">na</em> are empty because you didnt initialize <em class="text-italics">nc</em> (<em class="text-italics">na</em> is empty because you tried to find an empty nick with value <em class="text-italics">null</em> - nothing)<br><br>hence these two errors:<div class="codebox"><p>Code: </p><pre><code>chanserv.c:3611: warning: unused variable `na' chanserv.c:3610: warning: `nc' might be used uninitialized in this function </code></pre></div>second:<div class="codebox"><p>Code: </p><pre><code>if (!(access-&gt;nc-&gt;na-&gt;last_usermask)) {</code></pre></div>&amp;<div class="codebox"><p>Code: </p><pre><code>access-&gt;nc-&gt;na-&gt;last_usermask</code></pre></div>the structure <em class="text-italics">access</em> has a member called <em class="text-italics">nc</em> but <em class="text-italics">nc</em> doesnt have a member called <em class="text-italics">na</em>. maybe you should check the source files to see how the structure <em class="text-italics">ChanAccess</em> looks like. you should find a reference to another structure for <em class="text-italics">nc</em> so you can check what the members in that structure are...<br><br>hence these two errors:<div class="codebox"><p>Code: </p><pre><code>chanserv.c:3621: structure has no member named `na' chanserv.c:3628: structure has no member named `na' </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2999">Galadhrim</a> — Mon Mar 14, 2005 6:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-02-15T23:47:46-04:00</updated>

		<published>2005-02-15T23:47:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46654#p46654</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46654#p46654"/>
		<title type="html"><![CDATA[Help with Pointers - Need to tweak a little C function]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46654#p46654"><![CDATA[
This is not the most accurate place to ask, but anyway this is related to C, so anyway here goes.<br><br>I am using anope services (ChanServ, NickServ... etc) <a href="http://www.anope.org" class="postlink">www.anope.org</a> on my IRC network (bahamut-1.8.3) and wanted to modify their accest lists so that they also show ip address infront of nicknames, the last seen ip address of that registered nick, like DALnet has in their aop/sop/akick lists.<br><br>I modified the following code:<br><div class="codebox"><p>Code: </p><pre><code>static int xop_list(User * u, int index, ChannelInfo * ci, int *sent_header,int xlev, int xmsg) {ChanAccess *access = &amp;ci-&gt;access[index];NickAlias *na;if (!access-&gt;in_use || access-&gt;level != xlev)return 0;if (!*sent_header) {notice_lang(s_ChanServ, u, xmsg, ci-&gt;name);*sent_header = 1;}notice_lang(s_ChanServ, u, CHAN_XOP_LIST_FORMAT, index + 1,access-&gt;nc-&gt;display, na-&gt;last_usermask);return 1;}</code></pre></div>To this code, when I asked a project developer of anope team:<br><div class="codebox"><p>Code: </p><pre><code>static int xop_list(User * u, int index, ChannelInfo * ci,int *sent_header, int xlev, int xmsg){NickCore *nc;ChanAccess *access = &amp;ci-&gt;access[index];NickAlias *na = findnick(nc-&gt;display);if (!access-&gt;in_use || access-&gt;level != xlev) {return 0;}if (!*sent_header) {notice_lang(s_ChanServ, u, xmsg, ci-&gt;name);*sent_header = 1;}if (!(access-&gt;nc-&gt;na-&gt;last_usermask)) {notice_lang(s_ChanServ, u, CHAN_XOP_LIST_FORMAT, index + 1,access-&gt;nc-&gt;display, "(no record for userhost has been found)");}else {notice_lang(s_ChanServ, u, CHAN_XOP_LIST_FORMAT, index + 1,access-&gt;nc-&gt;na-&gt;last_usermask);}return 1;}</code></pre></div><br>This is the generated error by the compiler:<br><blockquote class="uncited"><div>$ make<br>sh version.sh<br>gcc -O2 -Wall -g -c chanserv.c<br>chanserv.c: In function `xop_list':<br>chanserv.c<img alt=":3621:" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/3621.svg"> structure has no member named `na'<br>chanserv.c<img alt=":3628:" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/3628.svg"> structure has no member named `na'<br>chanserv.c<img alt=":3611:" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/3611.svg"> warning: unused variable `na'<br>chanserv.c<img alt=":3610:" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/3610.svg"> warning: `nc' might be used uninitialized in this function<br>*** Error code 1</div></blockquote>If anyone is aware of this network services and know's  C, I would really appreciate if you could help me out here, especially in these pointers.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Tue Feb 15, 2005 11:47 pm</p><hr />
]]></content>
	</entry>
	</feed>
