diff options
author | Mykyta Holubakha <hilobakho@gmail.com> | 2016-07-04 10:41:29 +0300 |
---|---|---|
committer | Mykyta Holubakha <hilobakho@gmail.com> | 2016-07-04 10:41:29 +0300 |
commit | c625ed4b1a5404a1108e36e582b92ffc8b5fefc6 (patch) | |
tree | cb4cd8db170305201ce4e393dacbe83a9cc738e8 | |
parent | b1790c575cfb945b139e6a4836c5b39743b55458 (diff) |
do not write NUL to brightness file
-rw-r--r-- | brightnessctl.c | 2 |
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; |