diff options
Diffstat (limited to 'src/libnpass/util.c')
-rw-r--r-- | src/libnpass/util.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libnpass/util.c b/src/libnpass/util.c index e2bbbff..04f2a37 100644 --- a/src/libnpass/util.c +++ b/src/libnpass/util.c @@ -1,10 +1,11 @@ #include <sys/stat.h> -#include <string.h> + +#include <ctype.h> #include <errno.h> +#include <libgen.h> #include <linux/limits.h> -#include <ctype.h> +#include <string.h> #include <unistd.h> -#include <libgen.h> #include "libnpass/util.h" #include "util.h" @@ -18,7 +19,7 @@ int r_mkdir(const char *path, mode_t mode) strncpy(tmp, path, sizeof(tmp)); len = strlen(tmp); - if(tmp[len - 1] == '/') + if (tmp[len - 1] == '/') tmp[len - 1] = '\0'; for (p = tmp + 1; *p; ++p) { @@ -45,7 +46,7 @@ int r_rmdir(const char *prefix_path, char *rm_path) return 0; r = snprintf(abs_path, sizeof(abs_path), "%s/%s", prefix_path, rm_path); - if (r > (int) sizeof(abs_path)) + if (r > (int)sizeof(abs_path)) err_ret(1, "path exceeded PATH_MAX"); r = rmdir(abs_path); |