Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a8237fd authored by Shuzhen Wang's avatar Shuzhen Wang
Browse files

Camera: Fix localtime month formatting

tm_month starts from 0, and tm_day starts from 1. So when formatting the
month field, needs to + 1.

Test: Observe the name of the dumped image
Bug: 193263059
Change-Id: Ib968b13dde24031c128d8bf15e3b6eb1a38f03d7
parent 2a3ca76a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1092,7 +1092,7 @@ void Camera3OutputStream::dumpImageToDisk(nsecs_t timestamp,
    time_t now = time(0);
    tm *localTime = localtime(&now);
    snprintf(imageFileName, sizeof(imageFileName), "IMG_%4d%02d%02d_%02d%02d%02d_%" PRId64 ".%s",
            1900 + localTime->tm_year, localTime->tm_mon, localTime->tm_mday,
            1900 + localTime->tm_year, localTime->tm_mon + 1, localTime->tm_mday,
            localTime->tm_hour, localTime->tm_min, localTime->tm_sec,
            timestamp, fileExtension.c_str());