fix possible segfault in assignment

This commit is contained in:
rexy712
2018-05-08 11:26:18 -07:00
parent 3c867bd5aa
commit 87d70841b0

View File

@@ -158,6 +158,10 @@ void fade_out(int iv, int fv, int ms_duration, int steps){
step_delta += step_inc;
}
fd = fopen(backlight_file, "w+");
if(!fd){
io_error_2(IO_ERROR_OPEN, IO_ERROR_FILE, backlight_dir, backlight_file);
return;
}
fprintf(fd, "%d", fv);
fclose(fd);