Skip to content

Commit

Permalink
camera: fix torch value write function, used for video torch
Browse files Browse the repository at this point in the history
(sizeof vs strlen)

Change-Id: Ie9d102652c4787c49730ee22ce89539ff3144899
  • Loading branch information
tpruvot committed Mar 14, 2012
1 parent e8a524e commit 61e1db4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcamera/JordanCameraWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ setSocTorchMode(bool enable)
int fd = ::open("/sys/class/leds/torch-flash/flash_light", O_WRONLY);
if (fd >= 0) {
const char *value = enable ? "100" : "0";
write(fd, value, sizeof(value));
write(fd, value, strlen(value));
close(fd);
}
}
Expand Down

0 comments on commit 61e1db4

Please sign in to comment.