hyptop: Switch to util_str_toupper()

Instead of implementing our own version, use the available library
function util_str_toupper() from libutil.

Reviewed-by: Mete Durlu <meted@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Bjoern Walk <bwalk@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Bjoern Walk
2024-10-15 16:43:55 +02:00
committed by Jan Höppner
parent 938fe2a744
commit 1b18ba3a03
3 changed files with 6 additions and 14 deletions
-11
View File
@@ -354,17 +354,6 @@ out:
ht_reverse_off();
}
/*
* Convert string to uppercase
*/
void ht_str_to_upper(char *str)
{
while (*str) {
*str = toupper(*str);
str++;
}
}
/*
* Convert ext TOD to microseconds
*/
+2 -1
View File
@@ -12,6 +12,7 @@
#include <ctype.h>
#include <stdio.h>
#include "lib/util_libc.h"
#include "lib/zt_common.h"
#include "getopt.h"
@@ -404,7 +405,7 @@ static void l_verify_systems(struct hyptop_win *win)
if (sd_sys_get(sd_sys_root_get(), win->opts.sys.vec[i]))
continue;
sys_name = ht_strdup(win->opts.sys.vec[i]);
ht_str_to_upper(win->opts.sys.vec[i]);
util_str_toupper(win->opts.sys.vec[i]);
if (sd_sys_get(sd_sys_root_get(), win->opts.sys.vec[i])) {
ht_free(sys_name);
continue;
+4 -2
View File
@@ -16,6 +16,8 @@
#include <stdlib.h>
#include <string.h>
#include "lib/util_libc.h"
#include "helper.h"
#include "hyptop.h"
#include "table.h"
@@ -196,8 +198,8 @@ static void l_col_headline_init(struct table *t, struct table_col *col)
col->p->head_char[0] = col->hotkey;
strcpy(col->p->head_last, ++ptr);
if (!t->attr_sorted_table) {
ht_str_to_upper(col->p->head_first);
ht_str_to_upper(col->p->head_last);
util_str_toupper(col->p->head_first);
util_str_toupper(col->p->head_last);
col->p->head_char[0] = toupper(col->p->head_char[0]);
}
}