From: SourceForge.net <no...@so...> - 2004-08-24 01:39:39
|
Bugs item #882718, was opened at 2004-01-23 05:55 Message generated for change (Comment added) made by redi You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=107869&aid=882718&group_id=7869 Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Jonathan Wakely (redi) Summary: fields/FieldType.cc variable used before initialisation Initial Comment: In the constructors of FieldType the "m_uiMaxLength=0" should be put at the start of the constructors because setType subsequently needs to use it. ---------------------------------------------------------------------- >Comment By: Jonathan Wakely (redi) Date: 2004-08-24 01:39 Message: Logged In: YES user_id=426241 I've rewritten the ctors so the variables will be initialised when used. It'll do for now. ---------------------------------------------------------------------- Comment By: Jonathan Wakely (redi) Date: 2004-01-25 02:18 Message: Logged In: YES user_id=426241 Yes, you're right, thanks for reporting it. The class looks broken to me, since it calls the virtual get_MaxLength and set_MaxLength functions from the base ctor, which is usually a bad idea. Because the derived object is not constructed yet, only the base class versions are called, which uses an uninitialised variable. I think the comment in FieldType.cc about the ctor having too many args should be ignored and the max length and decimal count should be passed to the ctor if known (defaulting to zero). I'll look into it properly A.S.A.P and at least fix the uninitialised variables, but fixing it properly might require a bigger change. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=107869&aid=882718&group_id=7869 |