Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!, Google, Bing

Members: 0
Guests: 12
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWR FUSS » do_color() fails to close the...
Forum Rules | Mark all | Recent Posts

do_color() fails to close theme file
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 May 12, 2006, 3:22 pm   Last edited May 12, 2006, 7:18 pm by Halcyon
Go to the top of the page
Go to the bottom of the page

Halcyon
Magician
GroupMembers
Posts187
JoinedApr 12, 2005

While Remcon and I were playing around with fixing the blinking color issue, I noticed something strange when I would accidentally forget to put return carriages at the ends of my theme files... Since it causes the code to abort prematurely and assume an error, it'll never make it to the return catch, and passes on to "There was an error while loading theme" message. When I went to add the return and save it (I'm using Cygwin on Windows XP Media Center 2005, for those who don't know) WordPad would tell me that the file was in use by another program. Meaning? If the code encounters an EOF on read, it's not properly closing the file. This could be bad, so...

In color.c, in function do_color(), find:

            return;
         }
      }
      ch_printf( ch, "An error occured while trying to set color theme %s.\r\n", argument );
      return;
   }


Change that to:

            return;
         }
      }
	  fclose( fp );
      fp = NULL;
      ch_printf( ch, "An error occured while trying to set color theme %s.\r\n", argument );
      return;
   }


I had originally put in "if( fp )" but... Somehow, that doesn't make much sense. If it stopped, then it didn't close the file. Anyway, there it is. SOME good came of being so confidently ignorant on my "fixed" theme files. :smile:
       
Post is unread #2 May 12, 2006, 6:33 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,857
JoinedJul 26, 2005

Mine closes it correctly lol, and just checked stock SmaugFUSS and it also handles it correctly.
       
Post is unread #3 May 12, 2006, 7:19 pm   Last edited May 12, 2006, 7:19 pm by Halcyon
Go to the top of the page
Go to the bottom of the page

Halcyon
Magician
GroupMembers
Posts187
JoinedApr 12, 2005

Must just be another thing where SWR didn't get updated, then. It isn't closed properly in SWR.
       
Pages:<< prev 1 next >>