Opened 17 years ago

Closed 16 years ago

#2214 closed defect (fixed)

Get rid of fixed output buffer size in msIO_printf() and family

Reported by: dmorissette Owned by: dmorissette
Priority: normal Milestone: 5.2 release
Component: MapServer C Library Version: svn-trunk (development)
Severity: normal Keywords:
Cc: warmerdam, sdlime

Description

msIO_printf(), msIO_fprintf() and msIO_vfprintf() all have a fixed output buffer of 8000 bytes and attempts to write larger output result in an error. We need to get rid of this static limit.

In ticket #2213, Frank wrote:

The CPLString::Printf() implementation shows a pattern for trying again on failure with a larger buffer. Be careful about the va_copy() stuff as if you get it wrong it will still work on some systems but not others.

http://trac.osgeo.org/gdal/browser/trunk/gdal/port/cplstring.cpp#L84

Change History (2)

comment:1 by dmorissette, 16 years ago

Ticket #2599 depends on this fix.

comment:2 by dmorissette, 16 years ago

Resolution: fixed
Status: newclosed

Fixed in r7694 using a new _ms_vsprintf() function that implements a method similar to GDAL's CPLString::vPrintf().

msIO_printf(), msIO_fprintf() and msIO_vfprintf() all call _ms_vsprintf() to work with a dynamic buffer if the initial try with the local buffer fails.

Note: See TracTickets for help on using tickets.