diff options
Diffstat (limited to 'src/libnpass/libnpass.c')
-rw-r--r-- | src/libnpass/libnpass.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/libnpass/libnpass.c b/src/libnpass/libnpass.c index c04a2ab..1917db6 100644 --- a/src/libnpass/libnpass.c +++ b/src/libnpass/libnpass.c @@ -156,19 +156,18 @@ int pass_store_type(const char *spath) static int openstore(const char *spath, DIR **dirp) { - pass_store_t store_type; char abs_path[PATH_MAX]; const char *path; - int r; + int ret; - store_type = pass_store_type(spath); - if (store_type != PASS_STORE_DIR) - return (store_type < 0) ? store_type : -EINVAL; + ret = pass_store_type(spath); + if (ret != PASS_STORE_DIR) + return (ret < 0) ? ret : -EINVAL; if (spath) { - r = snprintf(abs_path, sizeof(abs_path), "%s/%s", pass_dir, - spath); - if (r < 0 || (size_t)r >= sizeof(abs_path)) + ret = snprintf(abs_path, sizeof(abs_path), "%s/%s", pass_dir, + spath); + if (ret < 0 || (size_t)ret >= sizeof(abs_path)) return_err(-ENAMETOOLONG, "Path exceeded PATH_MAX"); path = abs_path; |