diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/cla_parse.c | 4 | ||||
| -rw-r--r-- | src/create_pkg.c | 2 | ||||
| -rw-r--r-- | src/files.c | 2 | ||||
| -rw-r--r-- | src/is_updated.c | 2 | ||||
| -rw-r--r-- | src/lua_state.c | 2 | ||||
| -rw-r--r-- | src/update_all.c | 2 |
6 files changed, 6 insertions, 8 deletions
diff --git a/src/cla_parse.c b/src/cla_parse.c index 20f7c44..3ca79ca 100644 --- a/src/cla_parse.c +++ b/src/cla_parse.c @@ -70,7 +70,7 @@ void cmd_remove(int argc, char **argv, int i, Pkg pkg) { } void mod_flags(char **argv, int i) { - for (int j = 1; j < strlen(argv[i]); j++) { + for (size_t j = 1; j < strlen(argv[i]); j++) { switch (argv[i][j]) { case 'q': is_verbose = false; break; case 'f': is_forced = true; break; @@ -80,7 +80,7 @@ void mod_flags(char **argv, int i) { } void cmd_flags(int argc, char **argv, int i, Pkg pkg) { - for (int j = 1; j < strlen(argv[i]); j++) { + for (size_t j = 1; j < strlen(argv[i]); j++) { switch (argv[i][j]) { case 'a': cmd_add(argv, i); break; case 'b': cmd_build(argc, argv, i, pkg); break; diff --git a/src/create_pkg.c b/src/create_pkg.c index b65b49c..0137dd7 100644 --- a/src/create_pkg.c +++ b/src/create_pkg.c @@ -70,7 +70,7 @@ Pkg create_pkg(const char *arg) { char *verptr = strchr(new_arg, '@'); char *trgptr = strchr(new_arg, ','); - for (int i = 0; i < cached_repos_count; i++) { + for (size_t i = 0; i < cached_repos_count; i++) { if (strcmp(cached_repos[i].source_key, new_arg) != 0) continue; pkg.ver = cached_repos[i].version; } diff --git a/src/files.c b/src/files.c index 3e5df9f..38e87be 100644 --- a/src/files.c +++ b/src/files.c @@ -129,8 +129,6 @@ static int copy_at(int src_dir_fd, const char *src_path, int dst_dir_fd, const c fprintf(stderr, "copy_at: unsupported file inode type\n"); } -cleanup2: - close(dst_fd); cleanup1: close(src_fd); cleanup0: diff --git a/src/is_updated.c b/src/is_updated.c index 6ed53d3..124677a 100644 --- a/src/is_updated.c +++ b/src/is_updated.c @@ -26,7 +26,7 @@ bool is_bldit_usable() { char* bldit_version = bldit_getver(); if (strcmp(bldit_version, version) == 0) return true; bool prev_pass = false; - for (int i = 0; i < strlen(bldit_version); i++) { + for (size_t i = 0; i < strlen(bldit_version); i++) { if (bldit_version[i] == '.') continue; if ((bldit_version[i] - '0') <= (version[i] - '0')) { prev_pass = ((bldit_version[i] - '0') != (version[i] - '0')); diff --git a/src/lua_state.c b/src/lua_state.c index 7b038b6..9751780 100644 --- a/src/lua_state.c +++ b/src/lua_state.c @@ -597,7 +597,7 @@ bool bldit_uninstall(const char *target) { bool target_loop_success = target_loop_uninstall(B, "bldit.lua", target); lua_pop(B, 1); lua_close(B); - return true; + return target_loop_success; } void cache_repos() { diff --git a/src/update_all.c b/src/update_all.c index 16b8636..8a7d57f 100644 --- a/src/update_all.c +++ b/src/update_all.c @@ -23,7 +23,7 @@ void update_all() { while ((dirent_ptr = readdir(dir_ptr)) != NULL) { if (strcmp(dirent_ptr->d_name, "..") == 0 || strcmp(dirent_ptr->d_name, ".") == 0) continue; for (size_t i = 0; i < cached_repos_count; i++) { - if (!strcmp(dirent_ptr->d_name, cached_repos[i].source_key) == 0) continue; + if (strcmp(dirent_ptr->d_name, cached_repos[i].source_key) != 0) continue; Pkg pkg = create_pkg(cached_repos[i].source_value); update_pkg(pkg); } |
