From: Christos Zoulas Date: Sat, 17 Nov 2007 17:08:27 +0000 (+0000) Subject: fix core printing. X-Git-Tag: FILE4_22~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b0772fc9f726d7e70e5da2d20c34744589ca2c09;p=file fix core printing. --- diff --git a/src/readelf.c b/src/readelf.c index 793ead67..4f176e20 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -37,7 +37,7 @@ #include "readelf.h" #ifndef lint -FILE_RCSID("@(#)$File: readelf.c,v 1.65 2007/10/23 19:54:35 christos Exp $") +FILE_RCSID("@(#)$File: readelf.c,v 1.66 2007/11/07 21:26:32 christos Exp $") #endif #ifdef ELFCORE @@ -689,8 +689,10 @@ core: &nbuf[doff + prpsoffsets(i)]; for (cp = cname; *cp && isprint(*cp); cp++) continue; + if (cp > cname) + cp--; if (file_printf(ms, ", from '%.*s'", - (int)(cp - cname), cp) == -1) + (int)(cp - cname), cname) == -1) return size; *flags |= FLAGS_DID_CORE; return size;