From 7cc605cb0c0534b6444338a5879527facea23d57 Mon Sep 17 00:00:00 2001 From: Niclas Hofmann Date: Tue, 18 Jan 2022 14:26:59 +0100 Subject: [PATCH 1/3] cast unused return to void should solve the warning of unused return value. --- xdu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xdu.c b/xdu.c index 841da30..83163a3 100644 --- a/xdu.c +++ b/xdu.c @@ -730,10 +730,10 @@ void printpath(int x, int y) np = findnode(&top, x, y); if (np == NULL) return; - asprintf(&path, "%s", np->name); + (void) asprintf(&path, "%s", np->name); while (np->parent != NULL) { tmp_path = path; - asprintf(&path, "%s/%s", np->parent->name, path); + (void) asprintf(&path, "%s/%s", np->parent->name, path); np = np->parent; free(tmp_path); } From 1c8a6a0fe76dddb7f064cc0a144cfbf6e6fd6a05 Mon Sep 17 00:00:00 2001 From: Niclas Hofmann Date: Tue, 18 Jan 2022 15:01:50 +0100 Subject: [PATCH 2/3] fix format-overflow error Reduced the number of characters for representing the size of a file to 23. That number was choosen so that up to 999,999,999,999,999,999 bytes or ~999 pb can be represented including commata. --- xwin.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xwin.c b/xwin.c index 65518e8..0c6e3d1 100644 --- a/xwin.c +++ b/xwin.c @@ -210,6 +210,9 @@ static char defaultTranslations[] = "\ ALL_UNUSED_IMPL(VA_NUM_ARGS(__VA_ARGS__)) \ (__VA_ARGS__) +/* Assuming that there will never be a file lager than 999 petabytes. */ +#define MAX_NUMBER_LABEL_LENGTH 23 + /* * action routines */ @@ -500,7 +503,7 @@ void xrepaint() void readable_float(float number, char* number_label) { - char number_string[1024]; + char number_string[MAX_NUMBER_LABEL_LENGTH]; int i, j, length; sprintf(number_string, "%.2f", number); length = (strlen(number_string) - 4) / 3 + strlen(number_string); @@ -517,7 +520,7 @@ void readable_float(float number, char* number_label) void readable_long_long(long long number, char* number_label) { - char number_string[1024]; + char number_string[MAX_NUMBER_LABEL_LENGTH]; int i, j, length; sprintf(number_string, "%lld", number); length = (strlen(number_string) - 1) / 3 + strlen(number_string); @@ -537,7 +540,7 @@ void xdrawrect(char* name, long long size, int x, int y, int width, int height) int textx, texty; char label[1024]; - char number_label[1024]; + char number_label[MAX_NUMBER_LABEL_LENGTH]; XCharStruct overall; int ascent, descent, From 189d458c4b0f0188d32376704d6a33353fd2c461 Mon Sep 17 00:00:00 2001 From: Niclas Hofmann Date: Tue, 18 Jan 2022 15:11:09 +0100 Subject: [PATCH 3/3] update version and log for release 3.0p15 --- README.md | 8 ++++++++ version.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 77ac1b3..999a637 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,14 @@ This release was tested against MarIuX. ## Revision History +### Version 3.0p15 - Jan 18 2022 +- fix compilation problems with new gcc version +- Niclas Hofmann, `niclas@molgen.mpg.de` + +### Version 3.0p14 - Jul 20 2021 +- code fixes and optimizations +- Thomas Kreitler, `kreitler@molgen.mpg.de` + ### Version 3.0p13 - Mar 29 2019 - fix , as 1k divider for numerical output - Niclas Hofmann, `niclas@molgen.mpg.de` diff --git a/version.h b/version.h index 4091462..e5cbd05 100644 --- a/version.h +++ b/version.h @@ -1 +1 @@ -#define XDU_VERSION "3.0p14" +#define XDU_VERSION "3.0p15"