diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2019-03-17 17:19:45 -0400 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2019-04-06 10:31:25 -0700 |
commit | cf9e8c73c4ffa671d580938c9a84d6ef0bd2710d (patch) | |
tree | 21cd4cab8b92df9f9050ea8df40d9cc35bed451d /src/Error.c | |
parent | fb7e899e94dd402c868e8eb59ccf32284732f6ac (diff) |
This cleans up the "easy" warning fixes which can be made using my
Regress script, comparing object-files before/after the edits:
https://invisible-island.net/ansification/index.html
https://invisible-island.net/scripts/readme.html
The changes are casts, which quiet the gcc warnings about implicit
conversion that my "gcc-normal" script would show. I avoided
reformatting the code.
The change reduces the number of gcc warnings from 769 to 163.
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/Error.c')
-rw-r--r-- | src/Error.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Error.c b/src/Error.c index 18a80b5..44e8a2a 100644 --- a/src/Error.c +++ b/src/Error.c @@ -194,12 +194,12 @@ void XtAppGetErrorDatabaseText( #endif /* GLOBALERRORS */ } else (void) XrmGetResource(db, str_name, str_class, &type_str, &result); if (result.addr) { - (void) strncpy (buffer, result.addr, nbytes); + (void) strncpy (buffer, result.addr, (size_t) nbytes); if (result.size > (unsigned) nbytes) buffer[nbytes-1] = 0; } else { - int len = strlen(defaultp); + int len = (int) strlen(defaultp); if (len >= nbytes) len = nbytes-1; - (void) memmove(buffer, defaultp, len); + (void) memmove(buffer, defaultp, (size_t) len); buffer[len] = '\0'; } if (str_name) |