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, Yandex, Google

Members: 0
Guests: 5
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 » SmaugFUSS » Problem with editing stuff
Forum Rules | Mark all | Recent Posts

Problem with editing stuff
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Sep 16, 2005, 6:50 pm   Last edited Sep 17, 2005, 3:13 pm by Remcon
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,857
JoinedJul 26, 2005

Since I've seen some complain about this I decided to see if the issue was still there.
I had mentioned it to Samson the day after I found it but forgot to post it and he probably forgot it also.
So heres the fix for everyone :)
in build.c
in function copy_buffer_nohash
find
   for( x = 0; x < ch->editor->numlines; x++ )
   {
      mudstrlcpy( tmp, ch->editor->line[x], 100 );
      len = strlen( tmp );
      if( tmp && tmp[len - 1] == '~' )
         tmp[len - 1] = '\0';
      else
         mudstrlcat( tmp, "\n\r", 100 );
      smash_tilde( tmp );
      mudstrlcat( buf, tmp, 100 );
   }

change that to this
   for( x = 0; x < ch->editor->numlines; x++ )
   {
      mudstrlcpy( tmp, ch->editor->line[x], 100 );
      len = strlen( tmp );
      if( tmp && tmp[len - 1] == '~' )
         tmp[len - 1] = '\0';
      else
         mudstrlcat( tmp, "\n\r", 100 );
      smash_tilde( tmp );
      mudstrlcat( buf, tmp, MAX_STRING_LENGTH );
   }

in function copy_buffer
find
   for( x = 0; x < ch->editor->numlines; x++ )
   {
      mudstrlcpy( tmp, ch->editor->line[x], 100 );
      len = strlen( tmp );
      if( tmp && tmp[len - 1] == '~' )
         tmp[len - 1] = '\0';
      else
         mudstrlcat( tmp, "\n\r", 100 );
      /*
       * This is wrong 
       * smush_tilde(tmp);
       */
      smash_tilde( tmp );
      mudstrlcat( buf, tmp, 100 );
   }

change it to this
   for( x = 0; x < ch->editor->numlines; x++ )
   {
      mudstrlcpy( tmp, ch->editor->line[x], 100 );
      len = strlen( tmp );
      if( tmp && tmp[len - 1] == '~' )
         tmp[len - 1] = '\0';
      else
         mudstrlcat( tmp, "\n\r", 100 );
      /*
       * This is wrong 
       * smush_tilde(tmp);
       */
      smash_tilde( tmp );
      mudstrlcat( buf, tmp, MAX_STRING_LENGTH );
   }

The problem is that it was using mudstrlcat( buf, tmp, 100 ); the 100 should be MSL.
Sorry I hadn't posted it earlier.

Edited to change MSL to MAX_STRING_LENGTH
Keep forgetting not everyone has done that change yet lol :)

The complaints seem to be that if you edit something (that uses the editor) you end up with
only a line and a half and then it tosses in a ~ and ignores all the other data. It was just a
slight typo and simple to fix.
       
Pages:<< prev 1 next >>