mirror of
https://github.com/rfivet/uemacs.git
synced 2024-12-18 15:26:23 -05:00
Insure debug output fits inside terminal and buffer width.
This commit is contained in:
parent
e3c8805260
commit
01a84a3ac0
9
eval.c
9
eval.c
@ -798,11 +798,16 @@ int setvar(int f, int n)
|
|||||||
#if DEBUGM
|
#if DEBUGM
|
||||||
int mdbugout( char *fmt, char *s1, char *s2, char *s3) {
|
int mdbugout( char *fmt, char *s1, char *s2, char *s3) {
|
||||||
char outline[ NSTRING] ; /* global string to hold debug line text */
|
char outline[ NSTRING] ; /* global string to hold debug line text */
|
||||||
int c ; /* input from kbd */
|
int c, size ; /* input from kbd, output to terminal */
|
||||||
char *sp ; /* temp string pointer */
|
char *sp ; /* temp string pointer */
|
||||||
|
|
||||||
|
/* insure debug info fits in terminal and buffer width */
|
||||||
|
size = term.t_ncol + 1 ;
|
||||||
|
if( size > sizeof outline)
|
||||||
|
size = sizeof outline ;
|
||||||
|
|
||||||
/* assignment status ; variable name ; value we tried to assign */
|
/* assignment status ; variable name ; value we tried to assign */
|
||||||
sprintf( outline, fmt, s1, s2, s3) ;
|
snprintf( outline, size, fmt, s1, s2, s3) ;
|
||||||
|
|
||||||
/* expand '%' to "%%" so mlwrite wont bitch */
|
/* expand '%' to "%%" so mlwrite wont bitch */
|
||||||
sp = outline;
|
sp = outline;
|
||||||
|
Loading…
Reference in New Issue
Block a user