aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--brightnessctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/brightnessctl.c b/brightnessctl.c
index c873ec1..4f47cd1 100644
--- a/brightnessctl.c
+++ b/brightnessctl.c
@@ -290,7 +290,7 @@ int write_device(struct device *d) {
goto fail;
}
if ((f = fopen(dir_child(device_path(d), "brightness"), "w"))) {
- if (fwrite(c, 1, s + 1, f) < s + 1)
+ if (fwrite(c, 1, s, f) < s)
goto close;
} else
goto fail;