diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2022-06-16 16:06:42 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2022-06-18 06:36:42 -0400 |
commit | a80c543bb9955199619a2cb6280b89a879fd8811 (patch) | |
tree | 414b0e11a3977659d7e888deb69fb122eb532085 | |
parent | a6685523e189c6330ba7007ecaf8f6d462b63024 (diff) |
fixes for gcc13 warnings
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
-rw-r--r-- | src/Alloc.c | 4 | ||||
-rw-r--r-- | src/TMstate.c | 1 | ||||
-rw-r--r-- | util/makestrs.c | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/src/Alloc.c b/src/Alloc.c index 8cd3f5b..7271ca9 100644 --- a/src/Alloc.c +++ b/src/Alloc.c @@ -145,7 +145,9 @@ XtAsprintf(_XtString *new_string, _Xconst char *_X_RESTRICT_KYWD format, ...) *new_string = XtMalloc((Cardinal) len + 1); /* snprintf doesn't count trailing '\0' */ if ((size_t) len < sizeof(buf)) { - strncpy(*new_string, buf, (size_t) len); + if ((size_t) len > 0) { + memcpy(*new_string, buf, (size_t) len); + } (*new_string)[len] = '\0'; } else { diff --git a/src/TMstate.c b/src/TMstate.c index 8c7854d..e0414ca 100644 --- a/src/TMstate.c +++ b/src/TMstate.c @@ -1799,6 +1799,7 @@ MergeTranslations(Widget widget, bindings = NULL; } switch (operation) { + default: case XtTableReplace: newTable = bindPair[0].xlations = xlations; bindPair[0].bindings = bindings; diff --git a/util/makestrs.c b/util/makestrs.c index 4d5c0a6..10ceffb 100644 --- a/util/makestrs.c +++ b/util/makestrs.c @@ -345,6 +345,7 @@ WriteSourceLine(TableEnt * te, int abi, int fudge) { char *c; + (void) abi; for (c = te->right; *c; c++) (void) printf("'%c',", *c); (void) printf("%c", '0'); @@ -439,6 +440,7 @@ ArrayperWriteSource(int abi) File *phile; static int done_atom; + (void) abi; for (phile = file; phile; phile = phile->next) { Table *t; TableEnt *te; |