[PATCH] Fix off-by-one in elfcore_netbsd_get_lwpid()

Jason R Thorpe thorpej@wasabisystems.com
Mon Apr 1 10:31:00 GMT 2002


Fixes a silly string manipulation obob, spotted when manipulating
multi-LWP core files with GDB.

Committed to trunk as obvious.  OK for 2.12 branch?

2002-04-01  Nathan Williams  <nathanw@wasabisystems.com>

        * elf.c (elfcore_netbsd_get_lwpid): Fix off-by-one error
        which caused the returned LWP ID to always be 0.

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>
-------------- next part --------------
Index: elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.133
diff -u -r1.133 elf.c
--- elf.c	2002/03/27 00:16:54	1.133
+++ elf.c	2002/04/01 18:23:55
@@ -6441,7 +6441,7 @@
   cp = strchr (note->namedata, '@');
   if (cp != NULL)
     {
-      *lwpidp = atoi(cp);
+      *lwpidp = atoi(cp + 1);
       return true;
     }
   return false;


More information about the Binutils mailing list