Add patch to fix format errors

This commit is contained in:
Dridi Boukelmoune 2022-08-13 20:38:02 +02:00
parent 263ad33155
commit 290908c9d7
2 changed files with 38 additions and 1 deletions

36
format.patch Normal file
View File

@ -0,0 +1,36 @@
--- numatop-2.2/common/os/os_util.c 2021-09-08 04:29:54.000000000 +0200
+++ numatop-2.2/common/os/os_util.c 2022-08-13 15:24:06.607330278 +0200
@@ -387,12 +387,10 @@
int len = strlen(str);
boolean_t ret = B_FALSE;
- if ((scopy = malloc(len + 1)) == NULL) {
+ if ((scopy = strdup(str)) == NULL) {
return (B_FALSE);
}
- strncpy(scopy, str, len);
- scopy[len] = 0;
cur = scopy;
while (cur < (scopy + len)) {
--- numatop-2.2/common/reg.c 2021-09-08 04:29:54.000000000 +0200
+++ numatop-2.2/common/reg.c 2022-08-13 16:16:12.060462958 +0200
@@ -240,7 +240,7 @@
}
if (len > 0) {
- (void) mvwprintw(r->hdl, line, pos_x, content);
+ (void) mvwprintw(r->hdl, line, pos_x, "%s", content);
}
if (r->mode != 0) {
@@ -267,7 +267,7 @@
}
if (len > 0) {
- (void) mvwprintw(r->hdl, line, pos_x, content);
+ (void) mvwprintw(r->hdl, line, pos_x, "%s", content);
}
(void) wattroff(r->hdl, A_REVERSE | A_BOLD);

View File

@ -9,6 +9,7 @@ Summary: Memory access locality characterization and analysis
License: BSD
URL: https://01.org/numatop
Source: https://github.com/intel/numatop/archive/refs/tags/v%{version}.tar.gz
Patch0: format.patch
BuildRequires: autoconf
BuildRequires: automake
@ -33,7 +34,7 @@ NumaTOP supports the Intel Xeon processors and PowerPC processors.
%prep
%autosetup
%autosetup -p1
%build