diff options
| author | Tristan Riehs <tristan.riehs@inria.fr> | 2025-11-16 16:04:02 +0100 |
|---|---|---|
| committer | Tristan Riehs <tristan.riehs@inria.fr> | 2025-11-16 16:04:02 +0100 |
| commit | ae669917ba52bec2c99dd1741779447965d82dda (patch) | |
| tree | 7da7dcbfc9b62cf9f7f9b6cbf61a7ba1003a08c0 /src/main.c | |
| parent | 436673d30e387682f37171f5b27b0cd72ef64efb (diff) | |
Fix date parsing
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -237,7 +237,10 @@ static void ftag_add_one_file(sqlite3 *db, if (read_len > 1) { struct tm tm; memset(&tm, 0, sizeof(tm)); - rc = sscanf(date_str, "%d-%d-%d\n", &tm.tm_year, &tm.tm_mon, &tm.tm_mday); + rc = sscanf(date_str, "%d-%d-%d\n", + &tm.tm_year, &tm.tm_mon, &tm.tm_mday); + tm.tm_year -= 1900; + tm.tm_mon -= 1; date = mktime(&tm); if (rc != 3) { perror("sccanf"); |
