static int general_allocate_string(UI *ui, const char *prompt,
	int prompt_freeable, enum UI_string_types type, int input_flags,
	char *result_buf, int minsize, int maxsize, const char *test_buf)
	{
	int ret = -1;
	UI_STRING *s = general_allocate_prompt(ui, prompt, prompt_freeable,
		type, input_flags, result_buf);

	if (s)
		{
		if (allocate_string_stack(ui) >= 0)
			{
			s->_.string_data.result_minsize=minsize;
			s->_.string_data.result_maxsize=maxsize;
			s->_.string_data.test_buf=test_buf;
			ret=sk_UI_STRING_push(ui->strings, s);
			/* sk_push() returns 0 on error.  Let's addapt that */
			if (ret <= 0) ret--;
			}
		else
			free_string(s);
		}
	return ret;
	}