Skip to main content
Topic: max_chars in gimme_stop_name (Read 3089 times) previous topic - next topic

max_chars in gimme_stop_name

Reference: 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.

Re: max_chars in gimme_stop_name

Reply #1
one can also use cbuffer_t::printf in fahrplan_gui_t::gimme_stop_name.

Just make a patch :)
Parsley, sage, rosemary, and maggikraut.

Re: max_chars in gimme_stop_name

Reply #2
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...

 

Re: max_chars in gimme_stop_name

Reply #3
The linieneintrag came after this function. (However, I am not sure svn has this old revision.) The reason is completely historical.