summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-01-02 21:17:44 +0000
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-01-02 21:17:44 +0000
commit588f173adfcbf9e5fa52336899aea63d2163feec (patch)
treecdd548ab1b70b2ee38507b1c1cf0ec117331106c
parent3ace5d2f1ad5da470d4a42e1d8e51021072bae4a (diff)
downloadframeworks_native-588f173adfcbf9e5fa52336899aea63d2163feec.zip
frameworks_native-588f173adfcbf9e5fa52336899aea63d2163feec.tar.gz
frameworks_native-588f173adfcbf9e5fa52336899aea63d2163feec.tar.bz2
sensordevice: Dummy ALS: Solve fortified libc warning
convert sprint to snprintf, the size of the writes is always known Change-Id: I53ee36b67544ac25de7e5c05ce90b6817c8a9c92
-rw-r--r--services/sensorservice/SensorDevice.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/sensorservice/SensorDevice.cpp b/services/sensorservice/SensorDevice.cpp
index e115efc..709febf 100644
--- a/services/sensorservice/SensorDevice.cpp
+++ b/services/sensorservice/SensorDevice.cpp
@@ -159,7 +159,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;