blen = sizeof(tmp) - 1;
- if (!(path = getenv("XDG_RUNTIME_DIR")))
- return -1;
+ if (!(path = getenv("XDG_RUNTIME_DIR"))) return -1;
len = strlen(path);
if (len < blen)
{
- strncpy(tmp, path, len);
+ strncpy(tmp, path, len + 1);
strncat(tmp, "/e-wl-keymap-XXXXXX", 19);
}
else
- return -1;
+ {
+ return -1;
+ }
- if ((fd = mkstemp(tmp)) < 0) return -1;
+ if ((fd = mkstemp(tmp)) < 0)
+ {
+ return -1;
+ }
flags = fcntl(fd, F_GETFD);
if (flags < 0)
return;
}
- strncpy(e_comp_wl->xkb.area, tmp, e_comp_wl->xkb.size - 1);
+ strncpy(e_comp_wl->xkb.area, tmp, e_comp_wl->xkb.size);
free(tmp);
/* send updated keymap */
return;
}
- strncpy(new_path, home_dir, len1);
+ strncpy(new_path, home_dir, len1 + 1);
strncat(new_path, path + 1, len1 + len2);
epd->dir = eina_stringshare_add(new_path);
free(new_path);
return;
}
- strncpy(new_path, home_dir, len1);
+ strncpy(new_path, home_dir, len1 + 1);
strncat(new_path, path + 1, len1 + len2);
epd->dir = eina_stringshare_add(new_path);
free(new_path);
return;
}
- strncpy(new_path, home_dir, len1);
+ strncpy(new_path, home_dir, len1 + 1);
strncat(new_path, path + 1, len1 + len2);
epd->dir = eina_stringshare_add(new_path);
free(new_path);
len2 = strlen(path);
new_path = malloc(len1 + len2 + 1);
if (!new_path) return;
- strncpy(new_path, home_dir, len1);
+ strncpy(new_path, home_dir, len1 + 1);
strncat(new_path, path + 1, len1 + len2);
EINA_LIST_FOREACH(*(ep->user_dir_list), l, epd)
{
// 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);
- strncpy(name, id, strlen(id));
+ strncpy(name, id, strlen(id) + 1);
if ((p = strchr(name, '/'))) *p = 0;
s = _screen_id_find(id);
if (!cs) return NULL;
name = alloca(strlen(cs->id) + 1);
- strncpy(name, cs->id, strlen(cs->id));
+ strncpy(name, cs->id, strlen(cs->id) + 1);
if ((p = strchr(name, '/'))) *p = 0;
s = _screen_id_find(cs->id);
int priority;
Eina_Bool ok = EINA_FALSE;
Eina_Bool possible = EINA_FALSE;
+ int len = 0;
s = E_NEW(E_Randr2_Screen, 1);
if (!s) continue;
free(s);
continue;
}
- strncpy(s->id, s->info.name, strlen(s->info.name));
+ len = strlen(s->info.name);
+ strncpy(s->id, s->info.name, len + 1);
strncat(s->id, "/", 1);
- if (s->info.edid) strcat(s->id, s->info.edid);
+ if (s->info.edid) strncat(s->id, s->info.edid, strlen(s->info.edid));
printf("DRM RRR: Created Screen: %s\n", s->id);