diff options
author | Dmitry Shachnev <mitya57@gmail.com> | 2017-10-29 22:04:45 +0300 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2017-10-29 19:42:57 +0000 |
commit | 30eab68af8145e08d43e680b3e901b9efcf1d687 (patch) | |
tree | 7007531554b5538a03931765cfa52d295b0187e4 | |
parent | a1b6736e4f2daf86cd1626004d40ef57db85fbb5 (diff) |
Fix checking return value of endsWith
endsWith(buf, target) returns true when buf ends with target, not zero.
So the current condition is reversed and fails when link is not pointing
to qtchooser.
Change-Id: Ia854ed0030fc2723e23011aea2c097f90603a04b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | src/qtchooser/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qtchooser/main.cpp b/src/qtchooser/main.cpp index d028ee6..1a3aa99 100644 --- a/src/qtchooser/main.cpp +++ b/src/qtchooser/main.cpp @@ -225,7 +225,7 @@ bool linksBackToSelf(const char *link, const char *target) int count = readlink(link, buf, sizeof(buf) - 1); if (count >= 0) { buf[count] = '\0'; - if (endsWith(buf, target) == 0) { + if (endsWith(buf, target)) { fprintf(stderr, "%s: could not exec '%s' since it links to %s itself. Check your installation.\n", target, link, target); return true; |