| Protocol: | local | User: | |
| Machine: | localhost | CVSROOT: | /nfs/cavern/cvs |
|
Filename: QUANTAnet_perfMonitor_c.cxx | |||
| Revision 1.16 | scharver | 2004/03/25 03:39:17 | +84 -28 |
|
- QUANTAnet_perfMonitor_c constructor allocates its string buffers rather than setting them to NULL. Memory allocation is best done in the constructor anyhow. - Added a QUANTAnet_perfMonitor_c copy constructor that performs a deep copy from one object to another. Strings are copied to avoid shared pointers across multiple objects. - (QUANTAnet_perfMonitor_c::setIPs) Fixed memory leak caused by allocating a new character array everytime the function was called. Potentially dangerous. Since the memory was allocated in the constructor, the function now performs a strncpy. - (QUANTAnet_perfMonitor_c::updateStats) Changed the sprintf into resultantStats into a snprintf. snprintf isn't part of ANSI, but it's definitely present with tested systems. The Win32 version is _snprintf. This places a limit on the size of the destination in order to avoid a buffer overflow. Also changed formatting so that the code fits nicely on a printed page. | |||
| Show difference between Revision 1.15 and 1.16 | |||