mirror of
https://gitlab.freedesktop.org/xorg/lib/libx11.git
synced 2026-05-06 18:38:03 +02:00
XlcDL.c: replace strcpy+strcat sequences with snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
522989b343
commit
f7ecc0856b
1 changed files with 8 additions and 6 deletions
|
|
@ -267,18 +267,20 @@ __lc_path(const char *dl_name, const char *lc_dir)
|
|||
char *slash_p;
|
||||
slash_p = strrchr(lc_dir, '/');
|
||||
*slash_p = '\0';
|
||||
strcpy(path, lc_dir); strcat(path, "/");
|
||||
#if defined POSTLOCALELIBDIR
|
||||
strcat(path, POSTLOCALELIBDIR); strcat(path, "/");
|
||||
snprintf(path, len + 1, "%s/%s/%s.so.2",
|
||||
lc_dir, POSTLOCALELIBDIR, dl_name);
|
||||
#else
|
||||
snprintf(path, len + 1, "%s/%s.so.2", lc_dir, dl_name);
|
||||
#endif
|
||||
strcat(path, dl_name); strcat(path, ".so.2");
|
||||
*slash_p = '/';
|
||||
} else {
|
||||
strcpy(path, lc_dir); strcat(path, "/");
|
||||
#if defined POSTLOCALELIBDIR
|
||||
strcat(path, POSTLOCALELIBDIR); strcat(path, "/");
|
||||
snprintf(path, len + 1, "%s/%s/%s.so.2",
|
||||
lc_dir, POSTLOCALELIBDIR, dl_name);
|
||||
#else
|
||||
snprintf(path, len + 1, "%s/%s.so.2", lc_dir, dl_name);
|
||||
#endif
|
||||
strcat(path, dl_name); strcat(path, ".so.2");
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue