Pages:<< prev 1 next >>


Black Hand

GroupAdministrators
Posts3,707
JoinedJan 1, 2002
Version 1.54 of AFKMud has been released.
This is a bugfix/maintenance release.
Standard disclaimer type stuff: Changes in this version may or may not remain compatible with your
older support files, such as areas, commands, skills, socials, etc. If things break, you were warned.
Bugfixes this release:
Missing values from the ostat display were added. [Samson]
Prevented ACT_IMMORTAL mobs from being able to attack. [Adjani]
Prevented ACT_IMMORTAL mobs from being able to track. [Adjani]
Mob gold can now be set to -1 using the menu OLC. [Samson]
Web Server buffer overflow problem fixed. [Tomas Mecir]
Non-Bugfix alterations:
Removed the GET_INTERFACE and GET_WANT_RIPANSI connection states. [Samson]
Implemented the I3 permissions system for AFKMud. [Samson]
Messages added to inform new imms their I3 access elevated. [Samson]
Compatibility fix in I3 settings loaded from pfiles. [Samson]
This is a bugfix/maintenance release.
Standard disclaimer type stuff: Changes in this version may or may not remain compatible with your
older support files, such as areas, commands, skills, socials, etc. If things break, you were warned.
Bugfixes this release:
Missing values from the ostat display were added. [Samson]
Prevented ACT_IMMORTAL mobs from being able to attack. [Adjani]
Prevented ACT_IMMORTAL mobs from being able to track. [Adjani]
Mob gold can now be set to -1 using the menu OLC. [Samson]
Web Server buffer overflow problem fixed. [Tomas Mecir]
Non-Bugfix alterations:
Removed the GET_INTERFACE and GET_WANT_RIPANSI connection states. [Samson]
Implemented the I3 permissions system for AFKMud. [Samson]
Messages added to inform new imms their I3 access elevated. [Samson]
Compatibility fix in I3 settings loaded from pfiles. [Samson]


The Null Value

GroupAFKMud Team
Posts254
JoinedFeb 23, 2003
Getting a compile error here.. RedHat 7.3 machine
websvr.c: In function `handle_web':
websvr.c:377: parse error before `int'
websvr.c:378: `curlen' undeclared (first use in this function)
websvr.c:378: (Each undeclared identifier is reported only once
websvr.c:378: for each function it appears in.)
make[1]: *** [o/websvr.o] Error 1
Checked the code - LOOKS alright. That's both with the patch and with the downloaded distro.
[jwalker@kenetix src]$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)
[jwalker@kenetix src]$
I can't see anything wrong with the code though.
that's the block there I do think. It'd error out earlier if not.
-- X
websvr.c: In function `handle_web':
websvr.c:377: parse error before `int'
websvr.c:378: `curlen' undeclared (first use in this function)
websvr.c:378: (Each undeclared identifier is reported only once
websvr.c:378: for each function it appears in.)
make[1]: *** [o/websvr.o] Error 1
Checked the code - LOOKS alright. That's both with the patch and with the downloaded distro.
[jwalker@kenetix src]$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)
[jwalker@kenetix src]$
I can't see anything wrong with the code though.
if( FD_ISSET( current->fd, &readfds ) ) /* We Got Data! */ { char buf[MAXDATA]; int numbytes; if( ( numbytes = read( current->fd, buf, sizeof(buf) ) ) == -1 ) { perror( "web-read" ); continue; } buf[numbytes] = '�'; /* ensure that we won't crash on a buffer overflow */ int curlen = strlen( current->request ); strncat( current->request, buf, 2 * MAXDATA - curlen - 6 ); /* we don't want to miss the trailing ENDREQUEST */ if( strlen( current->request ) == 2 * MAXDATA - 6 ) /* buffer size reached */ /* we could miss the end of request, but we don't need it anyway */ strcat( current->request, ENDREQUEST ); } } /* DONE WITH DATA IN */
that's the block there I do think. It'd error out earlier if not.
-- X


The Null Value

GroupAFKMud Team
Posts254
JoinedFeb 23, 2003
Erm.. Fixed it up right quick when I looked again.
Basically I defined curlen up at the top with the other variables. For some reason my compiler didn't like the placement of that definition.
-- X
if( FD_ISSET( current->fd, &readfds ) ) /* We Got Data! */ { char buf[MAXDATA]; int numbytes; int curlen; if( ( numbytes = read( current->fd, buf, sizeof(buf) ) ) == -1 ) { perror( "web-read" ); continue; } buf[numbytes] = '�'; /* ensure that we won't crash on a buffer overflow */ curlen = strlen( current->request ); strncat( current->request, buf, 2 * MAXDATA - curlen - 6 ); /* we don't want to miss the trailing ENDREQUEST */ if( strlen( current->request ) == 2 * MAXDATA - 6 ) /* buffer size reached */ /* we could miss the end of request, but we don't need it anyway */ strcat( current->request, ENDREQUEST ); } } /* DONE WITH DATA IN */
Basically I defined curlen up at the top with the other variables. For some reason my compiler didn't like the placement of that definition.

-- X


Conjurer

GroupMembers
Posts395
JoinedMar 8, 2005
Hmmm, poking around the memory that working in PERL hasn't corrupted yet....
In standard ANSI C, all variable declarations have to occur at the top of the block whose scope they belong to, in ancient K&R, they had to occur at the top of the function. I learned C before the ANSI C99 definition existed, so if they changed it there... YMMV. I think you can get away with declaring anywhere in C++, but I don't know C++ very well.
THUS:
In standard ANSI C, all variable declarations have to occur at the top of the block whose scope they belong to, in ancient K&R, they had to occur at the top of the function. I learned C before the ANSI C99 definition existed, so if they changed it there... YMMV. I think you can get away with declaring anywhere in C++, but I don't know C++ very well.
THUS:
void foo(void) { int a = 1; // ok printf("%s ", blah()); { int b = 2; //ok printf("%d\n", b); } int c = 3; // bzzzt }



Apprentice

GroupAFKMud Team
Posts61
JoinedJan 1, 2002
In C++ a variable need be declared merely before it is invoked. It doesn't matter where (not counting things like in the middle of a function, etc ;P) or how soon before.
And I'm not even a coder!
And I'm not even a coder!


Black Hand

GroupAdministrators
Posts3,707
JoinedJan 1, 2002
This would be one of those lovely examples of how things have chaged under GCC3 and didn't get caught. I'll have to modify the patch and the distro later after work. Right now I can't do anything about it.
Edit: Ok, after taking a quicky look, the patch would have been too much of a pain to fix, so I only fixed this in the main distro package. It's a relatively minor thing that will only crop up if you aren't using gcc3, and most recent distros are doing that anyway. This will only affect patch users regardless. So if you get this, just follow the above fix to solve it.
Edit: Ok, after taking a quicky look, the patch would have been too much of a pain to fix, so I only fixed this in the main distro package. It's a relatively minor thing that will only crop up if you aren't using gcc3, and most recent distros are doing that anyway. This will only affect patch users regardless. So if you get this, just follow the above fix to solve it.
Pages:<< prev 1 next >>