mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-27 21:22:26 +00:00
Replace malloc/strlen/strcpy with strdup.
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
ea239112b0
commit
08adf41f63
10 changed files with 18 additions and 40 deletions
|
|
@ -479,12 +479,11 @@ static void setup_env(void) {
|
|||
pds = LAUNCHD_ID_PREFIX".X11";
|
||||
}
|
||||
|
||||
server_bootstrap_name = malloc(sizeof(char) * (strlen(pds) + 1));
|
||||
server_bootstrap_name = strdup(pds);
|
||||
if(!server_bootstrap_name) {
|
||||
fprintf(stderr, "X11.app: Memory allocation error.\n");
|
||||
exit(1);
|
||||
}
|
||||
strcpy(server_bootstrap_name, pds);
|
||||
setenv("X11_PREFS_DOMAIN", server_bootstrap_name, 1);
|
||||
|
||||
len = strlen(server_bootstrap_name);
|
||||
|
|
|
|||
Loading…
Reference in a new issue