- { if (strlen(textual_name)>765)
- error("Short name of object (in quotes) exceeded 765 characters");
- strncpy(shortname_buffer, textual_name, 765);
+ {
+ if (!glulx_mode) {
+ /* This check is only advisory. It's possible that a string of less than 765 characters will encode to more than 510 bytes. We'll double-check in write_property_block_z(). */
+ if (strlen(textual_name)>765)
+ error("Short name of object (in quotes) exceeded 765 Z-characters");
+ ensure_memory_list_available(&shortname_buffer_memlist, 766);
+ strncpy(shortname_buffer, textual_name, 765);
+ }
+ else {
+ ensure_memory_list_available(&shortname_buffer_memlist, strlen(textual_name)+1);
+ strcpy(shortname_buffer, textual_name);
+ }