summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2020-08-04 11:44:13 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-08-04 14:52:35 +0200
commit2d7667aa44780a5a4136b317d050b65d66da21eb (patch)
tree6e440adbad67a46e65b8fb58f26b35e6b25abad2
parentf953909f5965ff5f9bef49c87504fcfac9d51e7b (diff)
efl_ui_timepicker: Add null check for efl_text_get
Prevent null access of the string passed from efl_text_get. Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D12085
-rw-r--r--src/lib/elementary/efl_ui_timepicker.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/elementary/efl_ui_timepicker.c b/src/lib/elementary/efl_ui_timepicker.c
index d66ed0e853..9dfcd89b14 100644
--- a/src/lib/elementary/efl_ui_timepicker.c
+++ b/src/lib/elementary/efl_ui_timepicker.c
@@ -90,14 +90,14 @@ _field_changed_cb(void *data, const Efl_Event *ev)
90 if (ev->object == pd->hour) 90 if (ev->object == pd->hour)
91 { 91 {
92 pd->cur_time[TIMEPICKER_HOUR] = efl_ui_range_value_get(pd->hour); 92 pd->cur_time[TIMEPICKER_HOUR] = efl_ui_range_value_get(pd->hour);
93 if (!pd->is_24hour && !strcmp(efl_text_get(pd->ampm), "PM")) 93 if (!pd->is_24hour && eina_streq(efl_text_get(pd->ampm), "PM"))
94 pd->cur_time[TIMEPICKER_HOUR] += 12; 94 pd->cur_time[TIMEPICKER_HOUR] += 12;
95 } 95 }
96 else if (ev->object == pd->min) 96 else if (ev->object == pd->min)
97 pd->cur_time[TIMEPICKER_MIN] = efl_ui_range_value_get(pd->min); 97 pd->cur_time[TIMEPICKER_MIN] = efl_ui_range_value_get(pd->min);
98 else 98 else
99 { 99 {
100 if (!strcmp(efl_text_get(pd->ampm), "PM")) 100 if (eina_streq(efl_text_get(pd->ampm), "PM"))
101 { 101 {
102 efl_text_set(pd->ampm, "AM"); 102 efl_text_set(pd->ampm, "AM");
103 pd->cur_time[TIMEPICKER_HOUR] -= 12; 103 pd->cur_time[TIMEPICKER_HOUR] -= 12;