]> git.sesse.net Git - plocate/commitdiff
Fix display of rlim_t in ulimit error message on 32-bit platforms.
authorSteinar H. Gunderson <steinar+git@gunderson.no>
Tue, 3 Jan 2023 22:58:13 +0000 (23:58 +0100)
committerSteinar H. Gunderson <steinar+git@gunderson.no>
Tue, 3 Jan 2023 22:58:13 +0000 (23:58 +0100)
Reported by Jakub Wilk (Debian bug #1027702).

updatedb.cpp

index e1320b3e1ef58affd7dda61f7486921589754f8f..a10a3e7818dbc9bfbefe867700e895648aac9f04 100644 (file)
@@ -707,8 +707,8 @@ int scan(const string &path, int fd, dev_t parent_dev, dir_time modified, dir_ti
                                if (getrlimit(RLIMIT_NOFILE, &rlim) == -1) {
                                        fprintf(stderr, "Hint: Try `ulimit -n 131072' or similar.\n");
                                } else {
-                                       fprintf(stderr, "Hint: Try `ulimit -n %lu' or similar (current limit is %lu).\n",
-                                               rlim.rlim_cur * 2, rlim.rlim_cur);
+                                       fprintf(stderr, "Hint: Try `ulimit -n %" PRIu64 " or similar (current limit is %" PRIu64 ").\n",
+                                               static_cast<uint64_t>(rlim.rlim_cur * 2), static_cast<uint64_t>(rlim.rlim_cur));
                                }
                                exit(1);
                        }