- res = strplhead->str_names + strplhead->str_nalloc;
- plgtype(res, len);
- movestr(res, str, len);
- strplhead->str_nalloc += sizeof(lgtype) + len;
+ res = (struct strdesc *)(strplhead->str_names + strplhead->str_nalloc);
+ /*
+ * Save the string information that is always present
+ */
+ res->sd_stroff = strfilepos;
+ res->sd_strlen = len;
+ res->sd_place = place;
+ /*
+ * Now, save the string itself. If str is null, then
+ * the characters have already been dumped to the file
+ */
+ if ((place & STR_CORE) && str)
+ movestr(res[0].sd_string, str, len);
+ if (place & STR_FILE){
+ if (str){
+ fwrite(str, 1, len, strfile);
+ }
+ strfilepos += len;
+ }
+ /*
+ * Adjust the in core string pool size
+ */
+ strplhead->str_nalloc += tlen;