Introduce ARRAYSIZE

This commit is contained in:
Christian Göttsche
2020-09-28 21:14:50 +02:00
parent b82a13c6ba
commit 42946ec113
4 changed files with 7 additions and 3 deletions

View File

@ -22,7 +22,7 @@ void CRT_handleSIGSEGV(int sgn) {
#ifdef __linux
fprintf(stderr, "\n\nhtop " VERSION " aborting. Please report bug at https://htop.dev\n");
#ifdef HAVE_EXECINFO_H
size_t size = backtrace(backtraceArray, sizeof(backtraceArray) / sizeof(void *));
size_t size = backtrace(backtraceArray, ARRAYSIZE(backtraceArray));
fprintf(stderr, "\n Please include in your report the following backtrace: \n");
backtrace_symbols_fd(backtraceArray, size, 2);
fprintf(stderr, "\nAdditionally, in order to make the above backtrace useful,");

View File

@ -79,7 +79,7 @@ const SignalItem Platform_signals[] = {
{ .name = "31 SIGSYS", .number = 31 },
};
const unsigned int Platform_numberOfSignals = sizeof(Platform_signals)/sizeof(SignalItem);
const unsigned int Platform_numberOfSignals = ARRAYSIZE(Platform_signals);
static Htop_Reaction Platform_actionSetIOPriority(State* st) {
Panel* panel = st->panel;