From 1ae79e9a5303ec6873ecc26a0834d5a1017ecee6 Mon Sep 17 00:00:00 2001 From: JP Cimalando Date: Tue, 30 Jul 2019 18:35:58 +0200 Subject: [PATCH] sofd: skip strcpy in case of same source and destination --- dgl/src/sofd/libsofd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dgl/src/sofd/libsofd.c b/dgl/src/sofd/libsofd.c index 914a6e29..06273d4c 100644 --- a/dgl/src/sofd/libsofd.c +++ b/dgl/src/sofd/libsofd.c @@ -1257,7 +1257,8 @@ static int fib_opendir (Display *dpy, const char* path, const char *sel) { } else { int i; struct dirent *de; - strcpy (_cur_path, path); + if (path != _cur_path) + strcpy (_cur_path, path); if (_cur_path[strlen (_cur_path) -1] != '/') strcat (_cur_path, "/");