
PROBLEM:        (UTO100950)     (Patch ID: OSF375-350378)
********
This patch fixes a problem in which the tparm routine in the
libcurses.a library produces the wrong output value if the input parameter
has a value of more than three digits (greater than 999).

This patch fixes this problem and accepts a tparm parameter value of up to
four digits.

The following program can be run to reproduce the problem:

cat>>tparm_test.c<<EOF
#include <stdio.h>
#include <curses.h>
#include <term.h>

main()
{
    int lval;
    char *str;
    printf("enter value: ");
    scanf("%d", &lval);
    printf("enter value:%d\n ", lval);
    str = (char *)calloc(16, sizeof(char));
    strcpy(str, "\\E\[\%p1\%dX");
    printf("string for substitution: %s\n", str);
    str = (char *)tparm(str, lval);
    printf("string after substitution  : %s\n", str);
}
EOF

#cc -o tparm_test tparm_test.c -lcurses
#./tparm_test
enter value: 123
string for substitution: \E[%p1%dX
string after substitution  : \E[123X      (%p1 replaced by 123)
#
# ./tparm_test
enter value: 1234
string for substitution: \E[%p1%dX
string after substitution  : \E[<34X      (%p1 replaced by 34)
#
The correct string after substitution should be: \E[1234X

