diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-01-20 18:16:09 -0300 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-01-21 11:01:22 -0300 |
| commit | 29132d16965e66fed0bf7b38242e7e57df294ba0 (patch) | |
| tree | 5d78fb140c386372ef3edb821ba37a1bcd598996 /scripts | |
| parent | 9a0a5b5ac4372da84394dc329f763d6b7d384a86 (diff) | |
perf list: Don't write to const memory
Something now detected on fedora 44, where strchr() returns const if it
is passed a const pointer:
util/print-events.c: In function 'print_sdt_events':
util/print-events.c:89:29: error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
89 | char *bid = strchr(sdt_name->s, '@');
| ^~~~~~
Fix it by using strchrnul() + strncmp() instead of temporarily scrubbing
it with '\0'.
Reviewed-by: Ian Rogers <irogers@google.com>
Suggested-by: David Laight <david.laight.linux@gmail.com>
Link: https://lore.kernel.org/r/20260121112536.27fd5d11@pumpkin
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
