]> git.ipfire.org Git - pakfire.git/commitdiff
string: Silence a couple of format error warnings
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 4 Oct 2023 17:10:28 +0000 (17:10 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 4 Oct 2023 17:10:28 +0000 (17:10 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/cli/lib/progressbar.c
src/libpakfire/string.c

index e20ba10a510cda4069bd09f6c7e6669e1611644c..eb07aed92dd57bb60e14e04006e0f6ca2cc85398 100644 (file)
@@ -454,6 +454,8 @@ static int cli_progressbar_add_eta(struct cli_progressbar* p) {
        return cli_progressbar_add_widget(p, cli_progressbar_eta, NULL, 0, NULL);
 }
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
 static int cli_progressbar_format_speed(char** s, double value) {
        const char* units[] = {
                "%4.0fB/s",
@@ -512,6 +514,7 @@ static int __cli_progressbar_format_size(char* s, const size_t length, double va
 
        return 1;
 }
+#pragma GCC diagnostic pop
 
 static const char* cli_progressbar_bytes_transferred(struct cli_progressbar* p,
                struct cli_progressbar_widget* widget, unsigned int width, void* data) {
index 75262c019284575825ba4d55352ff3151b29916c..1a26ae566fec6a09134bd3353a656f79217814ef 100644 (file)
@@ -283,6 +283,8 @@ char* pakfire_string_join(char** list, const char* delim) {
        return string;
 }
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
 int __pakfire_format_size(char* dst, size_t length, double value) {
        const char* units[] = {
                "%.0f ",
@@ -361,6 +363,7 @@ int __pakfire_format_time(char* buffer, const size_t length, const time_t t) {
 
        return __pakfire_strftime(buffer, length, format, t);
 }
+#pragma GCC diagnostic pop
 
 char* pakfire_string_format_interval(const time_t t) {
        char* buffer = NULL;