cppinit.c (init_standard_includes, [...]): Use strncmp.
authorFrank Ch. Eigler <fche@redhat.com>
Sun, 6 Oct 2002 11:21:09 +0000 (11:21 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Sun, 6 Oct 2002 11:21:09 +0000 (11:21 +0000)
* cppinit.c (init_standard_includes, parse_option): Use strncmp.
* c-opts.c (find_opt): Similarly.

From-SVN: r57864

gcc/ChangeLog
gcc/c-opts.c
gcc/cppinit.c

index 2019210cd249b2b00f24398d299adf7f5b566e9e..1f8895bb35f1b8f1c6570179535c68f91f7e5180 100644 (file)
@@ -1,3 +1,8 @@
+2002-10-06  Frank Ch. Eigler  <fche@redhat.com>
+
+       * cppinit.c (init_standard_includes, parse_option): Use strncmp.
+       * c-opts.c (find_opt): Similarly.
+
 2002-10-05  Jakub Jelinek  <jakub@redhat.com>
 
        * gcc.c (set_multilib_dir): Don't access *end.
index 4d9e3d2dcf6bc07da1676552990ecef4ed94f92c..ba86e455729f21fd8550b940c5c1f3f3f60a7239 100644 (file)
@@ -400,7 +400,7 @@ find_opt (input, lang_flag)
       md = (mn + mx) / 2;
 
       opt_len = cl_options[md].opt_len;
-      comp = memcmp (input, cl_options[md].opt_text, opt_len);
+      comp = strncmp (input, cl_options[md].opt_text, opt_len);
 
       if (comp < 0)
        mx = md;
@@ -443,7 +443,7 @@ find_opt (input, lang_flag)
              for (md = md + 1; md < (size_t) N_OPTS; md++)
                {
                  opt_len = cl_options[md].opt_len;
-                 if (memcmp (input, cl_options[md].opt_text, opt_len))
+                 if (strncmp (input, cl_options[md].opt_text, opt_len))
                    break;
                  if (input[opt_len] == '\0')
                    return md;
index 8ec1b0e4bf4a8577ba9526c99a7f65c6238a9eb9..82b3056b704974c2a838dff0c7234c70e36cc0df 100644 (file)
@@ -808,7 +808,7 @@ init_standard_includes (pfile)
                  && !CPP_OPTION (pfile, no_standard_cplusplus_includes)))
            {
              /* Does this dir start with the prefix?  */
-             if (!memcmp (p->fname, default_prefix, default_len))
+             if (!strncmp (p->fname, default_prefix, default_len))
                {
                  /* Yes; change prefix and add to search list.  */
                  int flen = strlen (p->fname);
@@ -1229,7 +1229,7 @@ parse_option (input)
       md = (mn + mx) / 2;
 
       opt_len = cl_options[md].opt_len;
-      comp = memcmp (input, cl_options[md].opt_text, opt_len);
+      comp = strncmp (input, cl_options[md].opt_text, opt_len);
 
       if (comp > 0)
        mn = md + 1;
@@ -1254,7 +1254,7 @@ parse_option (input)
              for (; mn < (unsigned int) N_OPTS; mn++)
                {
                  opt_len = cl_options[mn].opt_len;
-                 if (memcmp (input, cl_options[mn].opt_text, opt_len))
+                 if (strncmp (input, cl_options[mn].opt_text, opt_len))
                    break;
                  if (input[opt_len] == '\0')
                    return mn;