summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-02-10 14:38:29 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-02-10 16:43:23 +0900
commitdc8da37878d143ff41986cf2aeb486d0d8f0284d (patch)
tree77e7ad47ee6b51d992c9fcde21c1d7a003b496f4
parent712daf38db32f16330e2eae40e19e3e9558645ee (diff)
elm - make progress test code a little more solid and nice to read
use sizeof the buffer rather than constant in snprint and 0.5 rather than .50 which almost looks like a typo... :) also use correct escape for % (%%%% so it becoems %% which is correct for a fmt string yto produce %)
-rw-r--r--src/bin/elementary/test_progressbar.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/elementary/test_progressbar.c b/src/bin/elementary/test_progressbar.c
index 3599c72f21..371c902bf0 100644
--- a/src/bin/elementary/test_progressbar.c
+++ b/src/bin/elementary/test_progressbar.c
@@ -164,7 +164,7 @@ test_progressbar(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
164 elm_box_pack_end(bx, hbx); 164 elm_box_pack_end(bx, hbx);
165 evas_object_show(hbx); 165 evas_object_show(hbx);
166 166
167 snprintf(form, 20, "%d percent (%d %%)", 50, 50); 167 snprintf(form, sizeof(form), "%d percent (%d%%%%)", 50, 50);
168 168
169 pb = elm_progressbar_add(win); 169 pb = elm_progressbar_add(win);
170 elm_progressbar_horizontal_set(pb, EINA_FALSE); 170 elm_progressbar_horizontal_set(pb, EINA_FALSE);
@@ -172,7 +172,7 @@ test_progressbar(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
172 evas_object_size_hint_align_set(pb, EVAS_HINT_FILL, EVAS_HINT_FILL); 172 evas_object_size_hint_align_set(pb, EVAS_HINT_FILL, EVAS_HINT_FILL);
173 elm_box_pack_end(hbx, pb); 173 elm_box_pack_end(hbx, pb);
174 elm_progressbar_unit_format_set(pb, form); 174 elm_progressbar_unit_format_set(pb, form);
175 elm_progressbar_value_set(pb, .50); 175 elm_progressbar_value_set(pb, 0.5);
176 elm_object_text_set(pb, "percent"); 176 elm_object_text_set(pb, "percent");
177 evas_object_show(pb); 177 evas_object_show(pb);
178 pd->pb4 = pb; 178 pd->pb4 = pb;