Skip to content

Commit

Permalink
Cleanup cppcheck warnings.
Browse files Browse the repository at this point in the history
Make cppcheck happy.

lib/search/regex.c:888:85: error: Uninitialized variable: *error [uninitvar]
        if (pcre2_jit_compile (mc_search_cond->regex_handle, PCRE2_JIT_COMPLETE) && *error != '\0')
                                                                                    ^
src/vfs/sftpfs/dir.c:95:26: warning: Uninitialized variable: handle [uninitvar]
    sftpfs_dir->handle = handle;
                         ^
Found by cppcheck-2.16.0

Signed-off-by: Andreas Mohr <[email protected]>
Signed-off-by: Andrew Borodin <[email protected]>
  • Loading branch information
Andreas Mohr authored and aborodin committed Dec 15, 2024
1 parent 6de5e62 commit 9ef2cb4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/search/regex.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ mc_search__cond_struct_new_init_regex (const char *charset, mc_search_t *lc_mc_s

#ifdef HAVE_PCRE2
int errcode;
char error[BUF_SMALL];
char error[BUF_SMALL] = "";
size_t erroffset;
int pcre_options = PCRE2_MULTILINE;
#else
Expand Down
2 changes: 1 addition & 1 deletion src/vfs/sftpfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ sftpfs_opendir (const vfs_path_t *vpath, GError **mcerror)
sftpfs_dir_data_t *sftpfs_dir;
sftpfs_super_t *sftpfs_super;
const vfs_path_element_t *path_element;
LIBSSH2_SFTP_HANDLE *handle;
LIBSSH2_SFTP_HANDLE *handle = NULL;
const GString *fixfname;

if (!sftpfs_op_init (&sftpfs_super, &path_element, vpath, mcerror))
Expand Down

0 comments on commit 9ef2cb4

Please sign in to comment.