Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e214f7c5 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

sensordevice: Dummy ALS: Solve fortified libc warning

convert sprint to snprintf, the size of the writes is always known

Change-Id: I53ee36b67544ac25de7e5c05ce90b6817c8a9c92
parent ce4876a9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -171,7 +171,7 @@ status_t SensorDevice::activate(void* ident, int handle, int enabled)
        if(fd < 0)
            return -ENODEV;

        nwr = sprintf(value, "%s\n", enabled ? "1" : "0");
        nwr = snprintf(value, 2, "%d\n", enabled ? 1 : 0);
        write(fd, value, nwr);
        close(fd);
        return 0;