Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, Yahoo!

Members: 0
Guests: 6
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » BugFix - Editor in 1.60
Forum Rules | Mark all | Recent Posts

BugFix - Editor in 1.60
< Newer Topic :: Older Topic > Whee!

Pages:<< prev 1 next >>
Post is unread #1 Nov 4, 2003, 4:01 pm
Go to the top of the page
Go to the bottom of the page

Xorith
The Null Value
GroupAFKMud Team
Posts254
JoinedFeb 23, 2003

Well, after bashing my head on the wall.. I managed to find the fix for the editor woes.

In editor.c, in both copy_buffer and copy_buffer_nohash, find the lines in the for loop that look like this:

mudstrlcat( buf, tmp, 100 );

in both, change it to:
mudstrlcat( buf, tmp, MSL );

Why? Well quite frankly it boggles me. The only thing I can figure is that it's limiting buf to 100 chars rather than strcat'ing the 100 chars from tmp to buf.

Oh yes, and to note: The editor DOES cut you off at 79 chars now, rather than 80. After some screwing around I've concluded that the fix is a tad more involved. First off, I don't quite understand why both the old editor.c and the one in 1.6 uses strlen(argument) > 79, yet the new one flags it as a long line while the old one didn't. Either way, even increasing this to 80 caused some issues. When going back into the buffer, it inserted a blank line. I think (and with more poking I can be sure) that this is also another issue of mis-matched integers. The only thing I'm curious about is why the sudden change...

-- Xorith
       
Post is unread #2 Nov 4, 2003, 4:08 pm
Go to the top of the page
Go to the bottom of the page

Xorith
The Null Value
GroupAFKMud Team
Posts254
JoinedFeb 23, 2003

Muhahahaha

To get your editor to support 80 lines once again, follow these steps:

Around line 559... where it says (Long line trimmed), change the strlen(argument) > 79 to strlen(argument) > 80.

Now, in start_editing() find:
if ( c == '
' || lpos > 78)
And change to
if ( c == '
' || lpos > 79)

This should successfuly modify the buffer to support a full 80-char per line (I hope).

Now, there might be need to change other size checks like this, but I've not discovered one yet. Thus, I'd rather not make changes to things that arn't apparently 'broken' ;)

-- Xorith
       
Post is unread #3 Nov 5, 2003, 2:52 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Heh, cool. One more nagging bug shot down. So from what I gather there aren't any others that need addressing just yet? I'm trying to avoid the whole "lets make 6 patches" problem previous releases had
       
Post is unread #4 Nov 5, 2003, 10:52 am
Go to the top of the page
Go to the bottom of the page

Quixadhal
Conjurer
GroupMembers
Posts398
JoinedMar 8, 2005

In editor.c, in both copy_buffer and copy_buffer_nohash, find the lines in the for loop that look like this:
mudstrlcat( buf, tmp, 100 );
in both, change it to:
mudstrlcat( buf, tmp, MSL );
Why? Well quite frankly it boggles me. The only thing I can figure is that it's limiting buf to 100 chars rather than strcat'ing the 100 chars from tmp to buf.

Yes, that is the behavior of both strlcat and strlcpy, you pass it the size of your buffer and it makes sure you don't overrun it. If you specifically only want 100 characters, that's the job of strncat/strncpy, and you have to do the subtraction yourself to not run off the end.
       
Post is unread #5 Nov 12, 2003, 3:59 am
Go to the top of the page
Go to the bottom of the page

Xorith
The Null Value
GroupAFKMud Team
Posts254
JoinedFeb 23, 2003

Delayed response, yes ;)

I thought the purpose was to append n characters to a buffer.

My mistake. ;)

-- X
       
Pages:<< prev 1 next >>