summaryrefslogtreecommitdiff
path: root/libexec/getty/chat.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* getty: code cleanup, part 2Dag-Erling Smørgrav2022-11-041-9/+9
| | | | | | | * Clean up whitespace * Reindent Sponsored by: Klara, Inc.
* getty: code cleanup, part 1Dag-Erling Smørgrav2022-11-041-7/+7
| | | | | | | | | | | | * Avoid unnecessary use of `unsigned char *` * Use explicit casts when assigning `unsigned char *` to `char *` or vice versa * Drop unused global variables (and fix memory leak in `gettable()`) * Use `snprintf()` instead of `strcpy()` + `strcat()` * Drop spurious braces in switch Sponsored by: Klara, Inc. Obtained from: Apple OSS Distributions (in part) Differential Revision: https://reviews.freebsd.org/D37263
* Fix potential buffer overflow and undefined behavior.Stefan Eßer2019-01-261-2/+2
| | | | | | | | | | | | | | | | The buffer allocated in read_chat() could be 1 element too short, if the chatstr parameter passed in is 1 or 3 charachters long (e.g. "a" or "a b"). The allocation of the pointer array does not account for the terminating NULL pointer in that case. Overlapping source and destination strings are undefined in strcpy(). Instead of moving a string to the left by one character just increment the char pointer before it is assigned to the results array. MFC after: 2 weeks Notes: svn path=/head/; revision=343479
* Build getty(8) with WARNS=6.Edward Tomasz Napierala2018-02-211-3/+3
| | | | | | | | | | Reviewed by: imp@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14197 Notes: svn path=/head/; revision=329724
* In libexec/getty/chat.c, replace && with & in chat_send(). The intentDimitry Andric2011-12-161-1/+1
| | | | | | | | | is to test if the CHATDEBUG_SEND bit is set in the chat_debug global. MFC after: 1 week Notes: svn path=/head/; revision=228582
* Add __unused. Ansi prototypes.Philippe Charnier2010-12-201-5/+3
| | | | Notes: svn path=/head/; revision=216582
* Include gettytab.h before extern.h so that the declarations of structStefan Farfeleder2005-04-061-0/+1
| | | | | | | gettyflags, gettynums and gettystrs are available. Notes: svn path=/head/; revision=144716
* Fixed a misspelling of 0 as NULL.Bruce Evans2004-03-141-1/+1
| | | | Notes: svn path=/head/; revision=126952
* Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/Jens Schweikhardt2002-12-301-1/+1
| | | | | | | Add FreeBSD Id tag where missing. Notes: svn path=/head/; revision=108470
* Removed unused include of <sys/resource.h> instead of depending onBruce Evans2002-02-251-12/+2
| | | | | | | | | | namespace pollution only 1 layer deep in <sys/stat.h> for its prerequisite <sys/time.h> Removed other unused includes. Notes: svn path=/head/; revision=91214
* o __P removalWarner Losh2002-02-061-32/+19
| | | | | | | | o remove register o use strict prototypes Notes: svn path=/head/; revision=90301
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50476
* Correct incompletes .Xrs. Remove duplicate #includes and unused variables.Philippe Charnier1997-11-211-10/+7
| | | | Notes: svn path=/head/; revision=31331
* Use cgetustr() since we handled special escapes ourselves.David Nugent1997-09-011-2/+2
| | | | | | | | | Fix typo in escape parsing function. PR: 4370 Submitted by: sumii@is.s.u-tokyo.ac.jp Notes: svn path=/head/; revision=29003
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-1/+1
| | | | Notes: svn path=/head/; revision=22989
* Tidy-up modem-chat handling: ensure tty modes are restored toDavid Nugent1997-02-091-34/+23
| | | | | | | | | | | | 'sane' standard (not raw) settings before abort/exiting; move responsibility of setting raw mode for chat-handling out of chat.c to avoid doing redundant tc{s,g}etattr()s; move DE pause prior setting standard mode before issue/login prompt to avoid echoing modem connect strings. Fixed up comment styles in a couple of places. Notes: svn path=/head/; revision=22491
* Added:David Nugent1997-02-021-0/+526
ic=expect/send script modem init script ac=expect/send script modem answer script ct#val chat script timeout (seconds) rt#val recycle timeout (seconds) if 'ac' set dc#val debug bitmask for debugging chat scripts hw (boolean) enable crtscts handshaking if=path 'issue' file sent prior login prompt chat.c is a simplistic expect/send chat module. Notes: svn path=/head/; revision=22208