/*
- * Copyright (C) 2009-2010 Andy Spencer <andy753421@gmail.com>
+ * Copyright (C) 2009-2011 Andy Spencer <andy753421@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/* Set time
* Do this before setting setting location
* so that it doesn't refresh twice */
- struct tm tm = {};
- strptime(time, "%Y-%m-%d %H:%M", &tm);
- time_t sec = mktime(&tm);
+ int year, mon, day, hour, min;
+ sscanf(time, "%d-%d-%d %d:%d", &year, &mon, &day, &hour, &min);
+ time_t sec = mktime(&(struct tm){0, year-1900, mon-1, day, hour, min});
if (sec > 0)
grits_viewer_set_time(gui->viewer, sec);
g_debug("date = [%s] == %lu\n", time, sec);
grits_viewer_set_offline(gui->viewer, offline);
set_toggle_action(gui, "update", autoupdate);
set_toggle_action(gui, "fullscreen", fullscreen);
+ g_free(prefs_site);
/* Done with init, show gui */
gtk_widget_show_all(GTK_WIDGET(gui));