aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/time_shift_dlg.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2011-08-16 17:51:38 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2011-08-16 17:51:38 +0000
commitc285091b7a54ef278bd0473c3d4cc15ce471f07a (patch)
tree09fed8a5cc058900606ec6905ce48e36e8c410b2 /gtk/time_shift_dlg.c
parent38b2b88fc1416f5c9c7435dca6947270cb4a7cf7 (diff)
Removed usage of localtime_r().
svn path=/trunk/; revision=38569
Diffstat (limited to 'gtk/time_shift_dlg.c')
-rw-r--r--gtk/time_shift_dlg.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/gtk/time_shift_dlg.c b/gtk/time_shift_dlg.c
index 6352d111d6..38c2e87d0f 100644
--- a/gtk/time_shift_dlg.c
+++ b/gtk/time_shift_dlg.c
@@ -435,10 +435,6 @@ time_shift_cb(GtkWidget *w _U_, gpointer d _U_)
window_present(time_shift_frame_w);
}
-#ifdef _MSC_VER
-#define localtime_r(a, b) memcpy((b), localtime((a)), sizeof(struct tm));
-#endif
-
static void
error_message(const gchar *msg)
{
@@ -634,7 +630,7 @@ timestring2nstime(const gchar *ts, nstime_t *packettime, nstime_t *nstime)
gchar *pts;
int h, m, Y, M, D;
long double f;
- struct tm tm, packettm;
+ struct tm tm, *tmptm;
time_t tt;
long double offset_float = 0;
@@ -681,15 +677,14 @@ timestring2nstime(const gchar *ts, nstime_t *packettime, nstime_t *nstime)
return(1);
}
- localtime_r(&(packettime->secs), &packettm);
-
/* Convert the time entered in an epoch offset */
- localtime_r(&(packettime->secs), &tm);
- if (Y == 0) {
- tm.tm_year = packettm.tm_year;
- tm.tm_mon = packettm.tm_mon;
- tm.tm_mday = packettm.tm_mday;
+ tmptm = localtime(&(packettime->secs));
+ if (tmptm) {
+ tm = *tmptm;
} else {
+ memset (&tm, 0, sizeof (tm));
+ }
+ if (Y != 0) {
tm.tm_year = Y - 1900;
tm.tm_mon = M - 1;
tm.tm_mday = D;