MCPcopy Index your code
hub / github.com/MapServer/MapServer / msStringConcatenate

Function msStringConcatenate

mapstring.c:1325–1354  ·  view source on GitHub ↗

* Concatenate pszSrc to pszDest and reallocate memory if necessary. */

Source from the content-addressed store, hash-verified

1323 * Concatenate pszSrc to pszDest and reallocate memory if necessary.
1324*/
1325char *msStringConcatenate(char *pszDest, const char *pszSrc)
1326{
1327 int nLen;
1328
1329 if (pszSrc == NULL)
1330 return pszDest;
1331
1332 /* if destination is null, allocate memory */
1333 if (pszDest == NULL) {
1334 pszDest = msStrdup(pszSrc);
1335 }
1336 else { /* if dest is not null, reallocate memory */
1337 char *pszTemp;
1338
1339 nLen = strlen(pszDest) + strlen(pszSrc);
1340
1341 pszTemp = (char*)realloc(pszDest, nLen + 1);
1342 if (pszTemp) {
1343 pszDest = pszTemp;
1344 strcat(pszDest, pszSrc);
1345 pszDest[nLen] = '\0';
1346 }
1347 else {
1348 msSetError(MS_MEMERR, "Error while reallocating memory.", "msStringConcatenate()");
1349 return NULL;
1350 }
1351 }
1352
1353 return pszDest;
1354}
1355
1356char *msJoinStrings(char **array, int arrayLength, const char *delimeter)
1357{

Callers 15

msSLDApplySLDFunction · 0.85
msSLDParseTextParamsFunction · 0.85
msSLDGenerateSLDFunction · 0.85
msSLDGetGraphicSLDFunction · 0.85
msSLDGenerateLineSLDFunction · 0.85
msSLDGeneratePolygonSLDFunction · 0.85
msSLDGeneratePointSLDFunction · 0.85
msSLDGenerateTextSLDFunction · 0.85
msSLDGenerateSLDLayerFunction · 0.85
msSLDBuildFilterEncodingFunction · 0.85
FLTApplySimpleSQLFilterFunction · 0.85

Calls 2

msStrdupFunction · 0.85
msSetErrorFunction · 0.85

Tested by

no test coverage detected