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

Function msWCSParseSizeString20

mapwcs20.c:543–581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

541/************************************************************************/
542
543static int msWCSParseSizeString20(char *string, char *outAxis, size_t axisStringLen, int *outSize)
544{
545 char *number = NULL;
546 char *check = NULL;
547
548 /* find first '(', the character before the number */
549 number = strchr(string, '(');
550
551 if(NULL == number)
552 {
553 msSetError(MS_WCSERR, "Invalid size parameter value.",
554 "msWCSParseSize20()");
555 return MS_FAILURE;
556 }
557
558 /* cut trailing ')' */
559 check = strchr(string, ')');
560 if(NULL == check)
561 {
562 msSetError(MS_WCSERR, "Invalid size parameter value.",
563 "msWCSParseSize20()");
564 return MS_FAILURE;
565 }
566 *number = '\0';
567 ++number;
568 *check = '\0';
569
570 strlcpy(outAxis, string, axisStringLen);
571
572 /* parse size value */
573 if(msStringParseInteger(number, outSize) != MS_SUCCESS)
574 {
575 msSetError(MS_WCSERR, "Parameter value '%s' is not a valid integer.",
576 "msWCSParseSize20()", number);
577 return MS_FAILURE;
578 }
579
580 return MS_SUCCESS;
581}
582
583/************************************************************************/
584/* msWCSParseResolutionString20() */

Callers 1

msWCSParseRequest20Function · 0.85

Calls 3

msSetErrorFunction · 0.85
strlcpyFunction · 0.85
msStringParseIntegerFunction · 0.85

Tested by

no test coverage detected