Jump to content
Sign in to follow this  
Cunoo

solved [HowTo] QUEST_STATE_MAX_LEN

Recommended Posts

Hi everyone,

I need change lenght for "QUEST_STATE_MAX_LEN".. Default size is 64, but I have after changes problems.. Just after open longest quest client frozen..

My changes:

Serverside:

common/tables.h

#define QUEST_STATE_MAX_LEN	64

to

#define QUEST_STATE_MAX_LEN	128

Clientside:

eterlib/parses.cpp // 2x

if (iValueLen >= 64)
				{
					TraceError("argument value overflow: must be shorter than 64 letters");
					return false;
				}

to

if (iValueLen >= 128)
				{
					TraceError("argument value overflow: must be shorter than 128 letters");
					return false;
				}

What can I do bad?

Edit: Ok I´m idiot!.. I forgot this:

char szValue[64 + 1];

to

char szValue[128 + 1];

same files in clientside before first code..

Okey thanks, here is free guide if someone need too :D

  • Love 1

Share this post


Link to post
Share on other sites
10 hours ago, Flourine said:

Buffer overflow i think. I had same and i used one fix from another forum

Yes you are right.. I create mistake in code.. Forgot change all code.. Now working fine..

10 hours ago, filipw1 said:

Why would I change that?

For example if you need more characters than 64 in your quest functions.. I want this for function "say_item"  because I need longer desc..

Share this post


Link to post
Share on other sites

You have the define for one reason, use it!

Stop hardcoding.

 

if (iValueLen >= QUEST_STATE_MAX_LEN)

char szValue[QUEST_STATE_MAX_LEN + 1];

  • Love 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.