[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
%c drops zero byte in ncurses-5.2-20020907
From: |
Frank Henigman |
Subject: |
%c drops zero byte in ncurses-5.2-20020907 |
Date: |
Fri, 04 Oct 2002 08:44:25 -0700 |
The %c code in a string like
cup=X%p1%cY%p2%cZ
can't produce a zero byte. Try
tput cup 0 0
and you get XYZ. Looking at
46 MODULE_ID("$Id: lib_tparm.c,v 1.59 2002/09/07 20:50:03 Philippe.Blain Exp
$")
one sees
537 case 'X': /* FALLTHRU */
538 case 'c': /* FALLTHRU */
539 save_number(format, npop(), len);
540 break;
and that save_number() uses strlen() to count the output bytes.
Obviously strlen() won't count a zero byte. I think the fix is
537 case 'X': /* FALLTHRU */
538 save_number(format, npop(), len);
539 break;
540
541 case 'c':
542 save_char(npop());
543 break;
Frank.
- %c drops zero byte in ncurses-5.2-20020907,
Frank Henigman <=