Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixes sorted by column crashing htop on osx #5

Merged
merged 1 commit into from

2 participants

@stepchud

Hi AndyA,

I found this patch in the discussion pages on your github account when searching for a solution to the problem. When htop is built from your osx branch, it works except when trying to sort by a specific column it causes an immediate crash. Since your version of htop-osx is the 'authoritative' and linked from several blogs, I thought I would submit this pull request for your attention.

@AndyA AndyA merged commit 45b718b into AndyA:osx
@mistydemeo mistydemeo referenced this pull request in Homebrew/homebrew
Closed

htop-osx error #12081

@mklein-de mklein-de referenced this pull request from a commit in mklein-de/htop-osx
@stormerider stormerider Initial work for Fan RPM monitoring.
Right now it collapses them together like CPU_TEMP does (see issue #5), and has hard coded values for the "heat" of the fan speed. What it should do instead is to use the current speed vs. the max speed (which I'm already pulling) and have the heat be based off of a percentage towards that. Say "warm" is 50%, "hot" is 80%, etc. Ideally this would also support other meter types than just text, as a fan RPM range is fairly easy to visualize-- I'm just not sure how to do other meter types yet.

This also does not currently track when the fan speed is "cold", ie, below the minimum value. I'm not sure how to represent that yet.
c1c4d51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 12, 2011
  1. fixes sort column causing crash

    Stephen Chudleigh authored
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 htop.c
View
4 htop.c
@@ -651,7 +651,7 @@ int main(int argc, char** argv) {
Panel* affinityPanel = AffinityPanel_new(pl->processorCount, curr);
- char* fuFunctions[2] = {"Set ", "Cancel "};
+ char* fuFunctions[] = {"Set ", "Cancel ", NULL};
void* set = pickFromVector(panel, affinityPanel, 15, headerHeight, fuFunctions, defaultBar);
if (set) {
unsigned long new = AffinityPanel_getAffinity(affinityPanel);
@@ -690,7 +690,7 @@ int main(int argc, char** argv) {
{
Panel* sortPanel = Panel_new(0, 0, 0, 0, LISTITEM_CLASS, true, ListItem_compare);
Panel_setHeader(sortPanel, "Sort by");
- char* fuFunctions[2] = {"Sort ", "Cancel "};
+ char* fuFunctions[] = {"Sort ", "Cancel ", NULL};
ProcessField* fields = pl->fields;
for (int i = 0; fields[i]; i++) {
char* name = String_trim(Process_fieldTitles[fields[i]]);
Something went wrong with that request. Please try again.