+
+ new_table = NULL;
+ for (pass = 0; pass < 2; ++pass) {
+ size_t str_size = 0;
+ char *raw_data = src->ext_str_table;
+ if (raw_data != NULL) {
+ for (i = 0; i < src->ext_Strings; ++i) {
+ size_t skip = strlen(raw_data) + 1;
+ if (skip != 1) {
+ if (pass) {
+ strcpy(new_table + str_size, raw_data);
+ }
+ str_size += skip;
+ raw_data += skip;
+ }
+ }
+ }
+ for (i = 0; i < NUM_EXT_NAMES(dst); ++i) {
+ if (VALID_STRING(src->ext_Names[i])) {
+ if (pass) {
+ strcpy(new_table + str_size, src->ext_Names[i]);
+ dst->ext_Names[i] = new_table + str_size;
+ }
+ str_size += strlen(src->ext_Names[i]) + 1;
+ }
+ }
+ if (pass) {
+ dst->ext_str_table = new_table;
+ } else {
+ ++str_size;
+ if ((new_table = calloc(str_size, 1)) == NULL)
+ _nc_err_abort(MSG_NO_MEMORY);
+ }
+ }