[Rawstudio-commit] r1976 - trunk/src
Anders Brander
anders at brander.dk
Tue Sep 2 07:14:57 CEST 2008
Author: abrander
Date: 2008-09-02 07:14:57 +0200 (Tue, 02 Sep 2008)
New Revision: 1976
Modified:
trunk/src/rs-utils.c
Log:
Valgrind, please shut up ;)
Modified: trunk/src/rs-utils.c
===================================================================
--- trunk/src/rs-utils.c 2008-09-02 05:02:32 UTC (rev 1975)
+++ trunk/src/rs-utils.c 2008-09-02 05:14:57 UTC (rev 1976)
@@ -63,12 +63,14 @@
GTime
rs_exiftime_to_unixtime(const gchar *str)
{
- struct tm tm;
+ struct tm *tm = g_new0(struct tm, 1);
GTime timestamp = -1;
- if (strptime(str, "%Y:%m:%d %H:%M:%S", &tm))
- timestamp = (GTime) mktime(&tm);
+ if (strptime(str, "%Y:%m:%d %H:%M:%S", tm))
+ timestamp = (GTime) mktime(tm);
+ g_free(tm);
+
return timestamp;
}
@@ -81,18 +83,20 @@
gchar *
rs_unixtime_to_exiftime(GTime timestamp)
{
- struct tm tm;
+ struct tm *tm = g_new0(struct tm, 1);
time_t tt = (time_t) timestamp;
gchar *result = g_new0(gchar, 20);
- gmtime_r(&tt, &tm);
+ gmtime_r(&tt, tm);
- if (strftime(result, 20, "%Y:%m:%d %H:%M:%S", &tm) != 19)
+ if (strftime(result, 20, "%Y:%m:%d %H:%M:%S", tm) != 19)
{
g_free(result);
result = NULL;
}
+ g_free(tm);
+
return result;
}
More information about the Rawstudio-commit
mailing list