forked from enlightenment/enlightenment
Use strdup
This commit is contained in:
parent
3c3a1ac603
commit
d2ccd898f9
|
@ -305,12 +305,8 @@ e_modapi_init(E_Module *m)
|
||||||
// Arbitrarily chosen a condition to check that rotation is enabled
|
// Arbitrarily chosen a condition to check that rotation is enabled
|
||||||
if (screen->info.can_rot_90 == EINA_TRUE)
|
if (screen->info.can_rot_90 == EINA_TRUE)
|
||||||
{
|
{
|
||||||
int max_screen_length = 300;
|
char *randr2_id = strdup(zone->randr2_id);
|
||||||
char *randr2_id = malloc(sizeof(char) * max_screen_length);
|
if (randr2_id == NULL)
|
||||||
int copied_chars = eina_strlcpy(randr2_id, zone->randr2_id, max_screen_length);
|
|
||||||
if (copied_chars > max_screen_length)
|
|
||||||
ERR("Screen name %s has been truncated. Cannot handle screens.", randr2_id);
|
|
||||||
if (copied_chars < 0)
|
|
||||||
ERR("Can't copy the screen name");
|
ERR("Can't copy the screen name");
|
||||||
|
|
||||||
inst->randr2_ids = eina_list_append(inst->randr2_ids, randr2_id);
|
inst->randr2_ids = eina_list_append(inst->randr2_ids, randr2_id);
|
||||||
|
|
Loading…
Reference in New Issue