From fa926beb7e8407608c56b4c30097cc631181140d Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Thu, 23 Dec 2021 13:26:14 -0500 Subject: Fix buffer size thinko. --- unsaver.1 | 18 +++++++++--------- unsaver.c | 2 +- unsaver.html | 8 ++++---- unsaver.rst | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/unsaver.1 b/unsaver.1 index 623a291..666520c 100644 --- a/unsaver.1 +++ b/unsaver.1 @@ -1,8 +1,5 @@ .\" Man page generated from reStructuredText. . -.TH UNSAVER 1 "2020-05-23" "0.4.0" "Urchlay" -.SH NAME -unsaver \- deactivate screensaver on joystick activity . .nr rst2man-indent-level 0 . @@ -30,6 +27,9 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. +.TH "UNSAVER" 1 "2021-12-23" "0.4.1" "Urchlay" +.SH NAME +unsaver \- deactivate screensaver on joystick activity .\" RST source for unsaver(1) man page. Convert with: . .\" rst2man.py unsaver.rst > unsaver.1 @@ -70,10 +70,10 @@ above. Use e.g. \fB\-i 300\fP, not \fB\-i300\fP\&. .SS General options .INDENT 0.0 .TP -.B \-\-help +.B \-\-help Print usage summary and exit. .TP -.B \-d +.B \-d Debug mode: run in foreground and print verbose messages. .UNINDENT .SS Monitoring options @@ -86,11 +86,11 @@ with \fIs\fP suffix (e.g. \fB1s\fP), or milliseconds with \fIm\fP to be in seconds if it\(aqs under 100, otherwise it\(aqs treated as milliseconds. Default: 250m. .TP -.B \-j +.B \-j Only monitor joysticks; don\(aqt try to detect fullscreen windows. \fB\-j\fP and \fB\-f\fP are mutually exclusive. .TP -.B \-f +.B \-f Only detect fullscreen windows; don\(aqt monitor joysticks. \fB\-j\fP and \fB\-f\fP are mutually exclusive. Note that \fBjoysticks\fP are ignored with \fB\-f\fP\&. @@ -114,7 +114,7 @@ applications don\(aqt normally respond to (6 or higher), but in some environments, the window manager responds to all the \(aqextra\(aq buttons as though they were button 1. .TP -.B \-m +.B \-m Send mouse movements rather than a keystroke. This will move the pointer 10 pixels to the right and down, then 10 pixels to the left and up, then warp the pointer back @@ -126,7 +126,7 @@ sending a fake keystroke/click/motion. It\(aqs recommended to set \fIinterval\fP to at least 1 second when using this option, to avoid excess process\-spawning overhead. .TP -.B \-x +.B \-x Same as \fB\-c "xscreensaver\-command \-deactivate" \-i 1s\fP\&. .UNINDENT .SH NOTES diff --git a/unsaver.c b/unsaver.c index 2cba2dc..a80e974 100644 --- a/unsaver.c +++ b/unsaver.c @@ -268,7 +268,7 @@ void open_joysticks(void) { void check_inotify() { int res; - res = read(inotify_fd, inotify_buf, sizeof(inotify_buf) + NAME_MAX + 1); + res = read(inotify_fd, inotify_buf, sizeof(struct inotify_event) + NAME_MAX + 1); if(res > 0) { if(debug) { diff --git a/unsaver.html b/unsaver.html index e64c712..55a0f04 100644 --- a/unsaver.html +++ b/unsaver.html @@ -3,9 +3,9 @@ - + unsaver - +