Do not cut off \0 anymore.

SVN revision: 69301
This commit is contained in:
Leif Middelschulte 2012-03-13 19:57:06 +00:00
parent b88eb4b9fc
commit ba9f6c43f6
3 changed files with 9 additions and 2 deletions

View File

@ -574,3 +574,8 @@
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

View File

@ -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:

View 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;