The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: gerw on March 04, 2009, 08:04:14 am

Title: max_chars in gimme_stop_name
Post by: gerw on March 04, 2009, 08:04:14 am
Reference: http://forum.simutrans.com/index.php?topic=1601.msg16748#msg16748 (http://forum.simutrans.com/index.php?topic=1601.msg16748#msg16748) (I didn't want to break that topic).

What's the usage of the parameter max_chars overall? It's only called with max_chars=512... And when you now add a new call to this function with another max_chars, things will break again...

My suggestions are:
- remove this parameter
- or use 'char* tmp = new char[max_chars];'

Edit:
Why is the index i and the schedule ptr fpl p****ed to the functions gimme_[short_]stop_name? IMHO it's sufficient to p**** only a linieneintrag_t to this functions.
Title: Re: max_chars in gimme_stop_name
Post by: Dwachs on March 04, 2009, 08:21:44 am
one can also use cbuffer_t::printf in fahrplan_gui_t::gimme_stop_name.

Just make a patch :)
Title: Re: max_chars in gimme_stop_name
Post by: gerw on March 04, 2009, 08:51:22 am
Ok. Patch attached :)

Since the name of a halt cannot exceed 256 chars (see gui/halt_info.*), the '...' aren't needed.

Edit: Patch really attached...
Title: Re: max_chars in gimme_stop_name
Post by: prissi on March 04, 2009, 09:59:14 am
The linieneintrag came after this function. (However, I am not sure svn has this old revision.) The reason is completely historical.