From c625ed4b1a5404a1108e36e582b92ffc8b5fefc6 Mon Sep 17 00:00:00 2001 From: Mykyta Holubakha Date: Mon, 4 Jul 2016 10:41:29 +0300 Subject: do not write NUL to brightness file --- brightnessctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'brightnessctl.c') 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; -- cgit v1.2.3