On Wed, 2010-06-23 at 18:16 +0200, strk wrote: > So, question is: are gstrdup and gstrdup_s > functions in geos_ts.cpp intended to include > or not a null termination ? > > Note that gstrdup_s takes a size but reads > one more byte from input pointer:
Sandro, Yes, these functions are dodgy, let's say, by design. It is not really possible to make such interface consistent and make one function working with both kinds of strings, std::string and C-string. The assumption is that user of gstrdup will learn its implementation to understand how to use it. Meaning, to keep value of size consistent with number of non-null characters. Best regards, -- Mateusz Loskot, http://mateusz.loskot.net _______________________________________________ geos-devel mailing list geos-devel@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/geos-devel