Cygwin: console: convert wpbuf_put to inline function
fix potential buffer overrun while at it Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
		| @@ -63,10 +63,13 @@ static struct fhandler_base::rabuf_t con_ra; | ||||
| static unsigned char wpbuf[WPBUF_LEN]; | ||||
| static int wpixput; | ||||
| static unsigned char last_char; | ||||
| #define wpbuf_put(x) \ | ||||
|   wpbuf[wpixput++] = x; \ | ||||
|   if (wpixput > WPBUF_LEN) \ | ||||
|     wpixput--; | ||||
|  | ||||
| static inline void | ||||
| wpbuf_put (unsigned char x) | ||||
| { | ||||
|   if (wpixput < WPBUF_LEN) | ||||
|     wpbuf[wpixput++] = x; | ||||
| } | ||||
|  | ||||
| static void | ||||
| beep () | ||||
|   | ||||
		Reference in New Issue
	
	Block a user