diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2017-07-26 16:16:10 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2017-07-26 16:16:10 -0300 |
commit | 3975e9ce5cba0e3972b2ddab28c198e000441501 (patch) | |
tree | db55e1d38775d02ba051cbb8235f4ad2b7bc53a9 /Settings.c | |
parent | 543d65c6ab767a53844c28d9e887440dec90da1c (diff) | |
parent | 821d50f0b49237052c988f4170737ebce17f33d6 (diff) |
Merge branch 'master' of https://github.com/hishamhm/htop
Diffstat (limited to 'Settings.c')
-rw-r--r-- | Settings.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -254,23 +254,29 @@ static bool Settings_read(Settings* this, const char* fileName) { static void writeFields(FILE* fd, ProcessField* fields, const char* name) { fprintf(fd, "%s=", name); + const char* sep = ""; for (int i = 0; fields[i]; i++) { // This "-1" is for compatibility with the older enum format. - fprintf(fd, "%d ", (int) fields[i]-1); + fprintf(fd, "%s%d", sep, (int) fields[i]-1); + sep = " "; } fprintf(fd, "\n"); } static void writeMeters(Settings* this, FILE* fd, int column) { + const char* sep = ""; for (int i = 0; i < this->columns[column].len; i++) { - fprintf(fd, "%s ", this->columns[column].names[i]); + fprintf(fd, "%s%s", sep, this->columns[column].names[i]); + sep = " "; } fprintf(fd, "\n"); } static void writeMeterModes(Settings* this, FILE* fd, int column) { + const char* sep = ""; for (int i = 0; i < this->columns[column].len; i++) { - fprintf(fd, "%d ", this->columns[column].modes[i]); + fprintf(fd, "%s%d", sep, this->columns[column].modes[i]); + sep = " "; } fprintf(fd, "\n"); } |