summaryrefslogtreecommitdiff
path: root/src/fr-command-rpm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fr-command-rpm.c')
-rw-r--r--src/fr-command-rpm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/fr-command-rpm.c b/src/fr-command-rpm.c
index 3c5c755..5fff8d7 100644
--- a/src/fr-command-rpm.c
+++ b/src/fr-command-rpm.c
@@ -49,19 +49,22 @@ 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;
}
+ }
} else
tm.tm_mon = 0;