Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ login database and alternate character search tool

login database and alternate character search tool

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1  2  3 

Posted by Nick Gammon   Australia  (23,169 posts)  Bio   Forum Administrator
Date Reply #30 on Wed 09 May 2007 05:07 AM (UTC)

Amended on Wed 09 May 2007 05:08 AM (UTC) by Nick Gammon

Message
Quote:

His character's name is Rand, could the code think it's looking up a random number because of that?


Hmmm - perhaps if I create a character called "Format c:" you would be in big trouble? Somehow I don't think so. (Or, Shutdown, or Reboot). ;)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Gohan_TheDragonball   USA  (183 posts)  Bio
Date Reply #31 on Wed 09 May 2007 08:09 AM (UTC)
Message
Let me get this out really quick, ROFL!!!!!! Ok now back to business, could you post what section of code surrounds line 2541 in save.c
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #32 on Wed 09 May 2007 10:10 PM (UTC)

Amended on Wed 09 May 2007 10:12 PM (UTC) by Conner

Message
It was just a thought, Nick. *shrug* (It's a linux box, so I suspect that format c wouldn't mean anything even if it did work that way.) ;)

Sure, here you go (the bolded line is 2541 itself):

            if ( !str_cmp( logon->name, argument ) )
            {
/*		// Have we already done a search for the argument on this day?
		if ( day == logon->day && month == logon->month && year == logon->year )
		{
		    continue;
		} */
                day = logon->day;
                month = logon->month;
                year = logon->year;
                sprintf( ipstring, "%s", logon->ip );
                for ( logon_temp = first_on; logon_temp; logon_temp = logon_temp->next )
                {
                    if ( (logon_temp->day == day) && (logon_temp->month == month) &&
                                (logon_temp->year == year) && str_cmp( logon_temp->name, argument ) )
                    {
                        if ( !str_cmp(ipstring,logon_temp->ip) )
                        {
			    recorded = FALSE;
			    for ( tmp = 0; tmp <= alts; tmp++ )
			    {
				if ( !str_cmp( altsearch_table[tmp].name, logon_temp->name ) )
				{
				    bool ip_found = FALSE;
				    for ( tmp2 = 0; tmp2 < altsearch_table[tmp].dif_ips; tmp2++ )
				    {
					if ( !str_cmp( altsearch_table[tmp].ip[tmp2], logon_temp->ip ) )
					{
					    altsearch_table[tmp].ip_track[tmp2]++;
					    ip_found = TRUE;
					}
				    }
				    if ( !ip_found )
				    {
					altsearch_table[tmp].ip[altsearch_table[tmp].dif_ips] = STRALLOC(ipstring);
				    	altsearch_table[tmp].dif_ips++;
				    }
				    altsearch_table[tmp].total_matches++;
				    recorded = TRUE;
				}
			    }
			    if ( !recorded )
			    {
				alts++;
				altsearch_table[alts].name = STRALLOC(logon_temp->name);
				altsearch_table[alts].ip[0] = STRALLOC(ipstring);
				altsearch_table[alts].dif_ips++;
				altsearch_table[alts].total_matches++;
			    }
                        }
                    }
                }
            }
        }

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by Gohan_TheDragonball   USA  (183 posts)  Bio
Date Reply #33 on Thu 10 May 2007 06:04 AM (UTC)

Amended on Thu 10 May 2007 06:06 AM (UTC) by Gohan_TheDragonball

Message
hmm ok i know whats probably wrong, you will want to change that section of code to such, the bold is the change:


			            for ( tmp2 = 0; tmp2 < altsearch_table[tmp].dif_ips; tmp2++ )
				    {
                                        if ( tmp2 >= MAX_IP_TRACK )
                                        {
                                            ip_found = TRUE;
                                            break;     
                                        }
					if ( !str_cmp( altsearch_table[tmp].ip[tmp2], logon_temp->ip ) )
					{
					    altsearch_table[tmp].ip_track[tmp2]++;
					    ip_found = TRUE;
					}
				    }


i am pretty sure it was an array out of bounds, hadn't run into it before so it never became an issue.
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #34 on Thu 10 May 2007 08:45 AM (UTC)
Message
Yup, that fixed it. Thanks! :)

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


122,598 views.

This is page 3, subject is 3 pages long:  [Previous page]  1  2  3 

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.