diff options
author | Michael Vetter <jubalh@iodoru.org> | 2022-04-29 14:46:09 +0200 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2022-04-29 15:40:56 +0200 |
commit | 188afc58da17f77692e44839eccd260321c7955c (patch) | |
tree | 15ef79452cca6736216dbb168ec3f326f5a7f50c /src | |
parent | c4d7f1c29a2b3bfed93fc322e77263c0cd3e371a (diff) | |
download | profani-tty-188afc58da17f77692e44839eccd260321c7955c.tar.gz |
Use 3 digits for rotated logfiles
profanity.log.001 -> 999.
Diffstat (limited to 'src')
-rw-r--r-- | src/log.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/log.c b/src/log.c index 296f20b5..191f8a84 100644 --- a/src/log.c +++ b/src/log.c @@ -237,9 +237,9 @@ _rotate_log_file(void) size_t len = strlen(log_file); gchar* log_file_new = malloc(len + 4); - // find an empty name. from .log -> log.01 -> log.99 - for (int i = 1; i < 100; i++) { - g_sprintf(log_file_new, "%s.%02d", log_file, i); + // find an empty name. from .log -> log.001 -> log.999 + for (int i = 1; i < 1000; i++) { + g_sprintf(log_file_new, "%s.%03d", log_file, i); if (!g_file_test(log_file_new, G_FILE_TEST_EXISTS)) break; } |