New common function "startswith"
[deliverable/binutils-gdb.git] / gdb / gcore.c
index 1ebff2a42036890196b4d21419530307d65239e7..3e05c612676c74861360bbadf0184af4e81058f4 100644 (file)
@@ -387,9 +387,9 @@ make_output_phdrs (bfd *obfd, asection *osec, void *ignored)
   int p_type = 0;
 
   /* FIXME: these constants may only be applicable for ELF.  */
-  if (strncmp (bfd_section_name (obfd, osec), "load", 4) == 0)
+  if (startswith (bfd_section_name (obfd, osec), "load"))
     p_type = PT_LOAD;
-  else if (strncmp (bfd_section_name (obfd, osec), "note", 4) == 0)
+  else if (startswith (bfd_section_name (obfd, osec), "note"))
     p_type = PT_NOTE;
   else
     p_type = PT_NULL;
@@ -562,7 +562,7 @@ gcore_copy_callback (bfd *obfd, asection *osec, void *ignored)
     return;
 
   /* Only interested in "load" sections.  */
-  if (strncmp ("load", bfd_section_name (obfd, osec), 4) != 0)
+  if (!startswith (bfd_section_name (obfd, osec), "load"))
     return;
 
   size = min (total_size, MAX_COPY_BYTES);
This page took 0.024103 seconds and 4 git commands to generate.