aboutsummaryrefslogtreecommitdiff
path: root/brightnessctl.c
diff options
context:
space:
mode:
authorGravatar Mykyta Holubakha <hilobakho@gmail.com>2016-07-04 10:41:29 +0300
committerGravatar Mykyta Holubakha <hilobakho@gmail.com>2016-07-04 10:41:29 +0300
commitc625ed4b1a5404a1108e36e582b92ffc8b5fefc6 (patch)
treecb4cd8db170305201ce4e393dacbe83a9cc738e8 /brightnessctl.c
parentb1790c575cfb945b139e6a4836c5b39743b55458 (diff)
do not write NUL to brightness file
Diffstat (limited to 'brightnessctl.c')
-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;