This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: Two small readelf.c fixes
- From: Roland McGrath <roland at hack dot frob dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Fri, 07 Sep 2012 10:08:08 -0700
- Subject: Re: Two small readelf.c fixes
> + snprintf (name, REGNAMESZ, "??? 0x%x", regno);
Always use %#x rather than 0x%x. But here you should not be doing this
way at all. Just do:
snprintf (name, REGNAMESZ, "reg%u", loc == NULL ? regno : loc->regno);
But, in fact, this looks like there was a latent bug already. It should
not be using LOC->regno at all, but just always REGNO here.
Thanks,
Roland