diff options
author | rbuj <[email protected]> | 2020-12-21 16:38:28 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2021-01-07 18:37:10 +0100 |
commit | 98759f7bed3768ef150dcd41f97f87cbb84be8b1 (patch) | |
tree | 9d36f1a67229a67a117c1f9583dafbe9d1b55a8b /src/fr-command-iso.c | |
parent | facddb5353b18d19c8a5b4f62b11ac0f6e666724 (diff) | |
download | engrampa-98759f7bed3768ef150dcd41f97f87cbb84be8b1.tar.bz2 engrampa-98759f7bed3768ef150dcd41f97f87cbb84be8b1.tar.xz |
Remove cppcheck warnings about the variable scope can be reduced
Diffstat (limited to 'src/fr-command-iso.c')
-rw-r--r-- | src/fr-command-iso.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/fr-command-iso.c b/src/fr-command-iso.c index 3be83db..ccc2333 100644 --- a/src/fr-command-iso.c +++ b/src/fr-command-iso.c @@ -47,19 +47,21 @@ mktime_from_string (char *month, char *mday, char *year) { - static const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; struct tm tm = {0, }; tm.tm_isdst = -1; if (month != NULL) { + static const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; int i; - for (i = 0; i < 12; i++) + + for (i = 0; i < 12; i++) { if (strcmp (months[i], month) == 0) { tm.tm_mon = i; break; } + } } tm.tm_mday = atoi (mday); tm.tm_year = atoi (year) - 1900; |