aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-08-22 14:18:29 (GMT)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-08-28 11:20:41 (GMT)
commitbbf6a11e5d726c9a86a1a6ad769119b6c2f7955c (patch)
tree5874d47814dc46739144ebf9e52f36f72f1a601d
parent08a0c60f1bff93a905fa4ca2b6fc0a2c7d2f68c1 (diff)
fileio: fix a bug preventing timestamp to show on remote file
When storing a remote file, the timestamp was not shown: Webcam-(null).jpeg That's because it was doing a sizeof(char *) instead of sizeof(char[str_len]). While here, get rid of the unused timenow var inside remote_save(). Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r--src/fileio.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/fileio.c b/src/fileio.c
index e3a2d37..065900c 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -90,7 +90,7 @@ void remote_save (cam * cam)
FILE *fp;
int bytes = 0, fc;
time_t t;
- gchar *timenow, *ext;
+ gchar *ext;
struct tm *tm;
gboolean pbs;
GdkPixbuf *pb;
@@ -117,10 +117,6 @@ void remote_save (cam * cam)
g_free (ext);
}
- time (&t);
- tm = localtime (&t);
- strftime (timenow, sizeof (timenow) - 1, "%s", tm);
-
filename = g_strdup_printf ("camorama.%s", ext);
pb = gdk_pixbuf_new_from_data (cam->tmp, GDK_COLORSPACE_RGB, FALSE, 8,
cam->width, cam->height,
@@ -235,7 +231,7 @@ void save_thread (cam * cam)
FILE *fp;
int bytes = 0;
time_t t;
- gchar *timenow, *ext;
+ char timenow[64], *ext;
struct tm *tm;
gboolean pbs;
GdkPixbuf *pb;

Privacy Policy