summaryrefslogtreecommitdiff
path: root/sdm/libs/core/fb/hw_device.cpp
diff options
context:
space:
mode:
authorRamkumar Radhakrishnan <ramkumar@codeaurora.org>2017-01-12 15:07:26 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-13 19:35:25 -0800
commit7054432687d6f20aa5d191b50b1ad9b8d54ce151 (patch)
tree6f58db2a2c840bb6b51ed0716049c9bffb5d5dac /sdm/libs/core/fb/hw_device.cpp
parent5bab554484633820d22b6c7411afb44ed12597a3 (diff)
downloaddisplay-7054432687d6f20aa5d191b50b1ad9b8d54ce151.tar.gz
sdm: Pass character pointer with NULL terminated string.
Pass character pointer with NULL terminated string to avoid undefined behavior while logging Change-Id: I77df09dc185b8aad07a68a564973231e479af76c CRs-Fixed: 1110993
Diffstat (limited to 'sdm/libs/core/fb/hw_device.cpp')
-rw-r--r--sdm/libs/core/fb/hw_device.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/sdm/libs/core/fb/hw_device.cpp b/sdm/libs/core/fb/hw_device.cpp
index 111e3866..b5233aef 100644
--- a/sdm/libs/core/fb/hw_device.cpp
+++ b/sdm/libs/core/fb/hw_device.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2014 - 2016, The Linux Foundation. All rights reserved.
+* Copyright (c) 2014 - 2017, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -1041,7 +1041,7 @@ int HWDevice::ParseLine(const char *input, const char *delim, char *tokens[],
bool HWDevice::EnableHotPlugDetection(int enable) {
char hpdpath[kMaxStringLength];
- char value = enable ? '1' : '0';
+ const char *value = enable ? "1" : "0";
// Enable HPD for all pluggable devices.
for (int i = 0; i < kFBNodeMax; i++) {
@@ -1050,7 +1050,7 @@ bool HWDevice::EnableHotPlugDetection(int enable) {
if (panel_info.is_pluggable == true) {
snprintf(hpdpath , sizeof(hpdpath), "%s%d/hpd", fb_path_, i);
- ssize_t length = SysFsWrite(hpdpath, &value, sizeof(value));
+ ssize_t length = SysFsWrite(hpdpath, value, 1);
if (length <= 0) {
return false;
}