← Commit list

9d858f571

Denys Vlasenko
Denys Vlasenko
2017-09-05
SUCCESS Duration: 145s

Subject

chat: do not die when HANGUP param is missing. Closes 10016

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

miscutils/chat.c+9 -1
@@ -238,10 +238,18 @@ int chat_main(int argc UNUSED_PARAM, char **argv)
, *argv
);
if (key >= 0) {
+ bool onoff;
// cache directive value
char *arg = *++argv;
+
+ if (!arg) {
+#if ENABLE_FEATURE_CHAT_TTY_HIFI
+ tcsetattr(STDIN_FILENO, TCSAFLUSH, &tio0);
+#endif
+ bb_show_usage();
+ }
// OFF -> 0, anything else -> 1
- bool onoff = (0 != strcmp("OFF", arg));
+ onoff = (0 != strcmp("OFF", arg));
// process directive
if (DIR_HANGUP == key) {
// turn SIGHUP on/off