Do not cut off \0 anymore.
authorleif <leif@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 13 Mar 2012 19:57:06 +0000 (19:57 +0000)
committerleif <leif@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 13 Mar 2012 19:57:06 +0000 (19:57 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@69301 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

ChangeLog
NEWS
src/lib/ecore_x/xlib/ecore_x_randr_12.c

index fc7bda8..ee58894 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 2012-03-10  Cedric Bail
 
        * Fix double free at end of execution of Ecore_Thread with feedback.
+
+2012-03-13  Leif Middelschulte (T_UNIX)
+
+        * Fix ecore_x_randr_modes_info_get to not cut off the trailing '\0'
+               anymore
diff --git a/NEWS b/NEWS
index d8c5d94..1c97372 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -42,6 +42,8 @@ Fixes:
     * ecore_thread:
      - ecore_thread_feedback_run now handle try_no_queue the way it logically should.
      - prevent double free that could cause crash when an Ecore_Thread stop.
+    * ecore_x:
+     - ecore_x_randr_modes_info_get does not cut off the trailing '\0' anymore.
 
 Improvements:
     * ecore:
index 2ad0dad..ec23b3c 100644 (file)
@@ -347,9 +347,9 @@ ecore_x_randr_modes_info_get(Ecore_X_Window root,
                        ret[i]->vSyncStart = res->modes[i].vSyncStart;
                        ret[i]->vSyncEnd = res->modes[i].vSyncEnd;
                        ret[i]->vTotal = res->modes[i].vTotal;
-                       if ((ret[i]->name = (malloc(res->modes[i].nameLength))))
+                       if ((ret[i]->name = (malloc(res->modes[i].nameLength + 1))))
                          strncpy(ret[i]->name, res->modes[i].name,
-                                 res->modes[i].nameLength);
+                                 (res->modes[i].nameLength + 1));
                        else
                          ret[i]->name = NULL;