News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

max_chars in gimme_stop_name

Started by gerw, March 04, 2009, 08:04:14 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gerw

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 passed to the functions gimme_[short_]stop_name? IMHO it's sufficient to pass only a linieneintrag_t to this functions.

Dwachs

one can also use cbuffer_t::printf in fahrplan_gui_t::gimme_stop_name.

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

gerw

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

prissi

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