View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000367VTK(No Category)public2003-11-12 07:542004-01-18 17:40
ReporterRoland Schwarz 
Assigned ToMathieu Malaterre 
PrioritylowSeverityminorReproducibilityalways
StatusclosedResolutionduplicate 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000367: Small Bug in vtkSetStringMacro
DescriptionIn the vtkSetStringMacro there seems to be a small Bug.

When the Debug flag is on the argument _arg will be sent to the ostream. This is not bad until the macro is beeing called with _arg == NULL. This seems to be the case i.e. in the destructor of vtkXMLWriter.

The following is from Common/vtkSetGet.h :

#define vtkSetStringMacro(name) \
virtual void Set##name (const char* _arg) \
  { \
  vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting " << #name " to " << _arg ); \
  if ( this->name == NULL && _arg == NULL) { return;} \
  if ( this->name && _arg && (!strcmp(this->name,_arg))) { return;} \
  if (this->name) { delete [] this->name; } \
  if (_arg) \
    { \
    this->name = new char[strlen(_arg)+1]; \
    strcpy(this->name,_arg); \
    } \
   else \
    { \
    this->name = NULL; \
    } \
  this->Modified(); \
  }

Best regards,
Roland
TagsNo tags attached.
Project
Type
Attached Files

 Relationships

  Notes
(0000506)
Mathieu Malaterre (developer)
2004-01-18 17:40

This is a duplicate of Bug 0000349 - vtkSetStringMacro prints a NULL character string

 Issue History
Date Modified Username Field Change
2011-06-16 13:11 Zack Galbreath Category => (No Category)


Copyright © 2000 - 2018 MantisBT Team