- for (begin_ptr= str, string= index(str, ',');
- begin_ptr != end_ptr;
- string= index(begin_ptr, ','))
- {
- port= 0;
-
- if (string)
- {
- memcpy(buffer, begin_ptr, (size_t)(string - begin_ptr));
- buffer[(unsigned int)(string - begin_ptr)]= '\0';
- begin_ptr= string + 1;
- }
- else
- {
- size_t length= strlen(begin_ptr);
- memcpy(buffer, begin_ptr, length);
- buffer[length]= '\0';
- begin_ptr= end_ptr;
- }
-
- ptr= index(buffer, ':');
-
- if (ptr != NULL)
- {
- ptr[0]= '\0';
- ptr++;
- port= strtol(ptr, (char **)NULL, 10);
- }