diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-08-15 15:29:03 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-08-15 15:58:37 +0300 |
commit | d07936aabadc99be885d6fed24d309e4611887c4 (patch) | |
tree | f15e71554e9d3bc5a66178ba1d65c84a8c5bfc34 /extra | |
parent | ec28f9532e92820f59fc7298465407069e289a5a (diff) | |
download | mariadb-git-d07936aabadc99be885d6fed24d309e4611887c4.tar.gz |
MDEV-19740: Silence a bogus "may be uninitialized" warning
Diffstat (limited to 'extra')
-rw-r--r-- | extra/innochecksum.cc | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc index a1ec663ee1a..4dca6572434 100644 --- a/extra/innochecksum.cc +++ b/extra/innochecksum.cc @@ -1590,10 +1590,8 @@ int main( byte* xdes = NULL; /* bytes read count */ ulint bytes; - /* current time */ - time_t now; /* last time */ - time_t lastt; + time_t lastt = 0; /* stat, to get file size. */ #ifdef _WIN32 struct _stat64 st; @@ -1946,7 +1944,6 @@ int main( /* main checksumming loop */ cur_page_num = start_page ? start_page : cur_page_num + 1; - lastt = 0; while (!feof(fil_in)) { bytes = read_file(buf, partial_page_read, @@ -2026,12 +2023,10 @@ first_non_zero: if (verbose && !read_from_stdin) { if ((cur_page_num % 64) == 0) { - now = time(0); + time_t now = time(0); if (!lastt) { lastt= now; - } - if (now - lastt >= 1 - && is_log_enabled) { + } else if (now - lastt >= 1 && is_log_enabled) { fprintf(log_file, "page::%llu " "okay: %.3f%% done\n", (cur_page_num - 1), |