]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/utils.c
New common function "startswith"
[thirdparty/binutils-gdb.git] / gdb / utils.c
index 4f9f4f05a2dd56e980d0ecddbe18e535282c7ba7..7172bba719e2e19a734fb09a694bedd276066e00 100644 (file)
@@ -2663,8 +2663,7 @@ subset_compare (char *string_to_compare, char *template_string)
   if (template_string != (char *) NULL && string_to_compare != (char *) NULL
       && strlen (string_to_compare) <= strlen (template_string))
     match =
-      (strncmp
-       (template_string, string_to_compare, strlen (string_to_compare)) == 0);
+      (startswith (template_string, string_to_compare));
   else
     match = 0;
   return match;
@@ -3278,7 +3277,7 @@ producer_is_gcc (const char *producer, int *major, int *minor)
 {
   const char *cs;
 
-  if (producer != NULL && strncmp (producer, "GNU ", strlen ("GNU ")) == 0)
+  if (producer != NULL && startswith (producer, "GNU "))
     {
       int maj, min;