discomfitor pushed a commit to branch enlightenment-0.21.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=b4574be2bce24a7dba6c5eb0959031e8791993e2

commit b4574be2bce24a7dba6c5eb0959031e8791993e2
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Fri Sep 1 13:40:12 2017 -0400

    check for matching '/' in screen edid before fuzzy matching in randr init
    
    if no / exists then this function is pointless
---
 src/bin/e_randr2.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/bin/e_randr2.c b/src/bin/e_randr2.c
index 9d08916ad..41c297da2 100644
--- a/src/bin/e_randr2.c
+++ b/src/bin/e_randr2.c
@@ -685,9 +685,11 @@ _screen_fuzzy_fallback_find(E_Config_Randr2 *cfg, const 
char *id)
    // strip out everythng in the string from / on as that is edid
    // and fall back to finding just the output name in the rel
    // to identifier, rather than the specific screen id
-   name = alloca(strlen(id) + 1);
-   strcpy(name, id);
-   if ((p = strchr(name, '/'))) *p = 0;
+   p = strchr(id, '/');
+   if (!p) return NULL;
+   name = alloca((p - id) + 1);
+   strncpy(name, id, p - id);
+   name[p - id] = 0;
 
    s = _screen_id_find(id);
    if (!s) s = _screen_output_find(name);

-- 


Reply via email to