Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Bing, DotBot, Yandex, Google

Members: 0
Guests: 12
Stats
Files
Topics
Posts
Members
Newest Member
481
3,739
19,386
622
ignatius
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,874
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 >>