]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/compulsory_tests/depends_exist.c
tools: Fixed unchecked *strrchr in a couple places.
[ccan] / tools / ccanlint / compulsory_tests / depends_exist.c
index 12eaf021410153c5567ea1abd22a98afa5ba0b51..b6be1f94b91ddd47f50538caa862cc9d511f44ed 100644 (file)
@@ -41,7 +41,8 @@ static void check_depends_exist(struct manifest *m,
        char **deps;
        char *updir = talloc_strdup(m, m->dir);
 
-       *strrchr(updir, '/') = '\0';
+       if (strrchr(updir, '/'))
+               *strrchr(updir, '/') = '\0';
 
        if (safe_mode)
                deps = get_safe_ccan_deps(m, m->dir, true,