projects
/
platform
/
core
/
system
/
sensord.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
00c3732
)
Removed compiler warning - ignoring return value
30/32730/1
author
Ankur
<ankur29.garg@samsung.com>
Tue, 23 Dec 2014 07:08:48 +0000
(12:38 +0530)
committer
Ankur
<ankur29.garg@samsung.com>
Tue, 23 Dec 2014 07:08:54 +0000
(12:38 +0530)
-Warning related to return value of asprintf() being ignored.
- asprintf returns -1 if failed. Added an if statement to check if the asprintf has failed or not.
Change-Id: I35a80554dd730e1722b975e488335910fd330d56
src/shared/iio_common.cpp
patch
|
blob
|
history
diff --git
a/src/shared/iio_common.cpp
b/src/shared/iio_common.cpp
index
a127ca0
..
7cfcba5
100644
(file)
--- a/
src/shared/iio_common.cpp
+++ b/
src/shared/iio_common.cpp
@@
-103,7
+103,9
@@
int add_channel_to_array(const char *device_dir, const char *ch_name, struct cha
if (i == 0)
return -1;
- asprintf(&(channel->prefix_str), "%s", ch_name);
+ if (asprintf(&(channel->prefix_str), "%s", ch_name) == -1)
+ return -1;
+
channel->is_en = 1;
channel->scale = 1.0;
channel->offset = 0.0;