-/* Sets V's short name to BASE, followed by a suffix of the form
- _A, _B, _C, ..., _AA, _AB, etc. according to the value of
- SUFFIX_NUMBER. Truncates BASE as necessary to fit. */
-static void
-set_var_short_name_suffix (struct variable *v, size_t i,
- const char *base, int suffix_number)
-{
- char suffix[SHORT_NAME_LEN + 1];
- char short_name[SHORT_NAME_LEN + 1];
- int len, ofs;
-
- assert (suffix_number >= 0);
-
- /* Compose suffix. */
- suffix[0] = '_';
- if (!str_format_26adic (suffix_number, &suffix[1], sizeof suffix - 1))
- msg (SE, _("Variable suffix too large."));
- len = strlen (suffix);
-
- /* Append suffix to V's short name. */
- str_copy_trunc (short_name, sizeof short_name, base);
- if (strlen (short_name) + len > SHORT_NAME_LEN)
- ofs = SHORT_NAME_LEN - len;
- else
- ofs = strlen (short_name);
- strcpy (short_name + ofs, suffix);
-
- /* Set name. */
- var_set_short_name (v, i, short_name);
-}
-