]> granicus.if.org Git - file/commitdiff
fix core printing.
authorChristos Zoulas <christos@zoulas.com>
Sat, 17 Nov 2007 17:08:27 +0000 (17:08 +0000)
committerChristos Zoulas <christos@zoulas.com>
Sat, 17 Nov 2007 17:08:27 +0000 (17:08 +0000)
src/readelf.c

index 793ead677d4790c0d0d46d4c27020ddcb7a9d4a5..4f176e2035d199552e80dec74e3a569f17ce1d9c 100644 (file)
@@ -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;