aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2015-12-19 10:19:25 -0800
committerUlrich Sibiller <uli42@gmx.de>2016-10-19 21:40:30 +0200
commitc9ebd122fb9b7c28abac21b83ade9fee365a882f (patch)
tree191c4ab4f2b23d475dd8701e289488194165c2e3 /nx-X11/lib
parent2874fd14b84994762f41f1f13dac5c1b09bed095 (diff)
downloadnx-libs-c9ebd122fb9b7c28abac21b83ade9fee365a882f.tar.gz
nx-libs-c9ebd122fb9b7c28abac21b83ade9fee365a882f.tar.bz2
nx-libs-c9ebd122fb9b7c28abac21b83ade9fee365a882f.zip
XlcDL.c: replace strcpy+strcat sequences with snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/lib')
-rw-r--r--nx-X11/lib/X11/XlcDL.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/nx-X11/lib/X11/XlcDL.c b/nx-X11/lib/X11/XlcDL.c
index a23603865..519103b86 100644
--- a/nx-X11/lib/X11/XlcDL.c
+++ b/nx-X11/lib/X11/XlcDL.c
@@ -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;
}