aboutsummaryrefslogtreecommitdiff
path: root/miscutils/conspy.c
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils/conspy.c')
-rw-r--r--miscutils/conspy.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/miscutils/conspy.c b/miscutils/conspy.c
index 1a46a4340..f6468c116 100644
--- a/miscutils/conspy.c
+++ b/miscutils/conspy.c
@@ -42,6 +42,7 @@
42//usage: "\n -y LINE Starting line" 42//usage: "\n -y LINE Starting line"
43 43
44#include "libbb.h" 44#include "libbb.h"
45#include "common_bufsiz.h"
45#include <sys/kd.h> 46#include <sys/kd.h>
46 47
47#define ESC "\033" 48#define ESC "\033"
@@ -363,7 +364,6 @@ int conspy_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
363int conspy_main(int argc UNUSED_PARAM, char **argv) 364int conspy_main(int argc UNUSED_PARAM, char **argv)
364{ 365{
365 char tty_name[sizeof(DEV_TTY "NN")]; 366 char tty_name[sizeof(DEV_TTY "NN")];
366#define keybuf bb_common_bufsiz1
367 struct termios termbuf; 367 struct termios termbuf;
368 unsigned opts; 368 unsigned opts;
369 unsigned ttynum; 369 unsigned ttynum;
@@ -382,6 +382,9 @@ int conspy_main(int argc UNUSED_PARAM, char **argv)
382 382
383 applet_long_options = getopt_longopts; 383 applet_long_options = getopt_longopts;
384#endif 384#endif
385#define keybuf bb_common_bufsiz1
386 setup_common_bufsiz();
387
385 INIT_G(); 388 INIT_G();
386 strcpy(G.vcsa_name, DEV_VCSA); 389 strcpy(G.vcsa_name, DEV_VCSA);
387 390
@@ -513,7 +516,7 @@ int conspy_main(int argc UNUSED_PARAM, char **argv)
513 default: 516 default:
514 // Read the keys pressed 517 // Read the keys pressed
515 k = keybuf + G.key_count; 518 k = keybuf + G.key_count;
516 bytes_read = read(G.kbd_fd, k, sizeof(keybuf) - G.key_count); 519 bytes_read = read(G.kbd_fd, k, COMMON_BUFSIZE - G.key_count);
517 if (bytes_read < 0) 520 if (bytes_read < 0)
518 goto abort; 521 goto abort;
519 522