summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2013-10-14 23:32:48 +0200
committerBoris Faure <billiob@gmail.com>2013-10-14 23:32:48 +0200
commitb66dc2a3a0c4fb09ef04283ab539f0432db1663d (patch)
treeaea094ec6cd63ac0c34a9148d4674b88e43087ce
parent46839daa9a12601c980c888b4242324035133dea (diff)
fix CID 1100641 - uninitialized scalar variable
-rw-r--r--src/bin/termio.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/bin/termio.c b/src/bin/termio.c
index 50f49e4..71c5123 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -1688,7 +1688,7 @@ _take_selection(Evas_Object *obj, Elm_Sel_Type type)
1688 Termio *sd = evas_object_smart_data_get(obj); 1688 Termio *sd = evas_object_smart_data_get(obj);
1689 int start_x = 0, start_y = 0, end_x = 0, end_y = 0; 1689 int start_x = 0, start_y = 0, end_x = 0, end_y = 0;
1690 char *s = NULL; 1690 char *s = NULL;
1691 size_t len; 1691 size_t len = 0;
1692 1692
1693 if (!sd) return; 1693 if (!sd) return;
1694 if (sd->cur.sel) 1694 if (sd->cur.sel)
@@ -1725,7 +1725,10 @@ _take_selection(Evas_Object *obj, Elm_Sel_Type type)
1725 eina_strbuf_free(sb); 1725 eina_strbuf_free(sb);
1726 } 1726 }
1727 else if (!start_y && !end_y && !start_x && !end_x && sd->link.string) 1727 else if (!start_y && !end_y && !start_x && !end_x && sd->link.string)
1728 s = strdup(sd->link.string); 1728 {
1729 len = strlen(sd->link.string);
1730 s = strndup(sd->link.string, len);
1731 }
1729 else if ((start_x != end_x) || (start_y != end_y)) 1732 else if ((start_x != end_x) || (start_y != end_y))
1730 { 1733 {
1731 if ((start_y > end_y) || ((start_y == end_y) && (end_x < start_x))) 1734 if ((start_y > end_y) || ((start_y == end_y) && (end_x < start_x)))
@@ -1738,7 +1741,7 @@ _take_selection(Evas_Object *obj, Elm_Sel_Type type)
1738 1741
1739 if (s) 1742 if (s)
1740 { 1743 {
1741 if (sd->win) 1744 if ((sd->win) && (len > 0))
1742 { 1745 {
1743 sd->have_sel = EINA_FALSE; 1746 sd->have_sel = EINA_FALSE;
1744 sd->reset_sel = EINA_FALSE; 1747 sd->reset_sel = EINA_FALSE;