Skip to content
Snippets Groups Projects
Commit 29824560 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Resolve warnings about ignored return values

As reported by GCC 10.2 with FORTIFY=1 and SANITIZE=1
parent 04457453
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4507 passed
......@@ -1198,7 +1198,8 @@ get_syncterm_filename(char *fn, int fnlen, int type, bool shared)
if (!shared) {
if (((home == NULL) || (strlen(home) > MAX_PATH - 32))) { /* $HOME just too damn big */
if ((type == SYNCTERM_DEFAULT_TRANSFER_PATH) || (type == SYNCTERM_PATH_CACHE)) {
getcwd(fn, fnlen);
if(getcwd(fn, fnlen) == NULL)
return NULL;
backslash(fn);
if (type == SYNCTERM_PATH_CACHE) {
strcat(fn, "cache");
......@@ -1539,8 +1540,7 @@ main(int argc, char **argv)
"\tcols#132,lines#60,use=syncterm-bitmap,\n";
if ((argc == 2) && (strcmp(argv[1], "-T") == 0)) {
write(STDOUT_FILENO, syncterm_termcap, strlen(syncterm_termcap));
return 0;
return write(STDOUT_FILENO, syncterm_termcap, strlen(syncterm_termcap)) > 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
if ((argc == 2) && (strcmp(argv[1], "-v") == 0)) {
fprintf(stdout, "%s\n", syncterm_version);
......
......@@ -2034,7 +2034,8 @@ xmodem_download(struct bbslist *bbs, long mode, char *path)
if (file_bytes < (ulong)filelength(fileno(fp))) {
lprintf(LOG_INFO, "Truncating file to %lu bytes", (ulong)file_bytes);
chsize(fileno(fp), (ulong)file_bytes); /* 4GB limit! */
if(chsize(fileno(fp), (ulong)file_bytes) != 0) /* 4GB limit! */
lprintf(LOG_ERR, "Error %d (%s) truncating file", errno, strerror(errno));
}
else {
file_bytes = filelength(fileno(fp));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment