mirror of
https://github.com/crash-utility/crash
synced 2025-02-09 01:46:55 +00:00
Fix gcc-11 compiler warning on symbols.c
Without the patch, the following gcc-11 compiler warning is emitted for symbols.c: symbols.c: In function 'cmd_p': symbols.c:7412:38: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] 7412 | *(cpuspec-1) = ':'; | ~~~~~~~~~~~~~^~~~~ Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
This commit is contained in:
parent
f374aca364
commit
b9c0ed124e
@ -7351,7 +7351,7 @@ cmd_p(void)
|
||||
unsigned radix;
|
||||
int do_load_module_filter;
|
||||
char buf1[BUFSIZE];
|
||||
char *cpuspec;
|
||||
char *cpuspec, *p;
|
||||
|
||||
do_load_module_filter = radix = 0;
|
||||
|
||||
@ -7386,7 +7386,7 @@ cmd_p(void)
|
||||
if (argerrs || !args[optind])
|
||||
cmd_usage(pc->curcmd, SYNOPSIS);
|
||||
|
||||
cpuspec = strrchr(args[optind], ':');
|
||||
p = cpuspec = strrchr(args[optind], ':');
|
||||
if (cpuspec)
|
||||
*cpuspec++ = NULLCHAR;
|
||||
|
||||
@ -7409,7 +7409,7 @@ cmd_p(void)
|
||||
sp->name);
|
||||
else
|
||||
/* maybe a valid C expression (e.g. ':') */
|
||||
*(cpuspec-1) = ':';
|
||||
*p = ':';
|
||||
}
|
||||
|
||||
process_gdb_output(concat_args(buf1, 0, TRUE), radix,
|
||||
|
Loading…
Reference in New Issue
Block a user