From 3a05efc9de4685b834447f5ad74536b9eb61cc92 Mon Sep 17 00:00:00 2001 From: Spekadyon Date: Sat, 14 Dec 2024 20:05:12 +0100 Subject: [PATCH 1/2] Add missing output string size to snprintf --- src/appimagetool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/appimagetool.c b/src/appimagetool.c index 96e6283..06d7e08 100644 --- a/src/appimagetool.c +++ b/src/appimagetool.c @@ -949,7 +949,7 @@ main (int argc, char *argv[]) if(zsyncmake_path){ char buf[1024]; // gh-releases-zsync|probono|AppImages|latest|Subsurface-*x86_64.AppImage.zsync - int ret = snprintf(buf, "gh-releases-zsync|%s|%s|latest|%s*-%s.AppImage.zsync", github_repository_owner, github_repository_name, app_name_for_filename, arch); + int ret = snprintf(buf, sizeof(buf), "gh-releases-zsync|%s|%s|latest|%s*-%s.AppImage.zsync", github_repository_owner, github_repository_name, app_name_for_filename, arch); if (ret < 0) { die("snprintf error"); } else if (ret >= sizeof(buf)) { From d120a8c5f5bb5260aab15b2bc5c9707b49b7af2a Mon Sep 17 00:00:00 2001 From: Spekadyon Date: Sat, 14 Dec 2024 20:06:42 +0100 Subject: [PATCH 2/2] Fix compiler warning: use "%zu" instead of "%d" for size_t --- src/appimagetool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/appimagetool.c b/src/appimagetool.c index 06d7e08..a62795f 100644 --- a/src/appimagetool.c +++ b/src/appimagetool.c @@ -913,7 +913,7 @@ main (int argc, char *argv[]) } } if (verbose) - printf("Size of the embedded runtime: %d bytes\n", size); + printf("Size of the embedded runtime: %zu bytes\n", size); int result = sfs_mksquashfs(source, destination, size); if(result != 0)