Commit 7c7c549e by Frank Ch. Eigler Committed by Neil Booth

cppinit.c (init_standard_includes, [...]): Use strncmp.

	* cppinit.c (init_standard_includes, parse_option): Use strncmp.
	* c-opts.c (find_opt): Similarly.

From-SVN: r57864
parent 23ee9159
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> 2002-10-05 Jakub Jelinek <jakub@redhat.com>
* gcc.c (set_multilib_dir): Don't access *end. * gcc.c (set_multilib_dir): Don't access *end.
......
...@@ -400,7 +400,7 @@ find_opt (input, lang_flag) ...@@ -400,7 +400,7 @@ find_opt (input, lang_flag)
md = (mn + mx) / 2; md = (mn + mx) / 2;
opt_len = cl_options[md].opt_len; 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) if (comp < 0)
mx = md; mx = md;
...@@ -443,7 +443,7 @@ find_opt (input, lang_flag) ...@@ -443,7 +443,7 @@ find_opt (input, lang_flag)
for (md = md + 1; md < (size_t) N_OPTS; md++) for (md = md + 1; md < (size_t) N_OPTS; md++)
{ {
opt_len = cl_options[md].opt_len; 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; break;
if (input[opt_len] == '\0') if (input[opt_len] == '\0')
return md; return md;
......
...@@ -808,7 +808,7 @@ init_standard_includes (pfile) ...@@ -808,7 +808,7 @@ init_standard_includes (pfile)
&& !CPP_OPTION (pfile, no_standard_cplusplus_includes))) && !CPP_OPTION (pfile, no_standard_cplusplus_includes)))
{ {
/* Does this dir start with the prefix? */ /* 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. */ /* Yes; change prefix and add to search list. */
int flen = strlen (p->fname); int flen = strlen (p->fname);
...@@ -1229,7 +1229,7 @@ parse_option (input) ...@@ -1229,7 +1229,7 @@ parse_option (input)
md = (mn + mx) / 2; md = (mn + mx) / 2;
opt_len = cl_options[md].opt_len; 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) if (comp > 0)
mn = md + 1; mn = md + 1;
...@@ -1254,7 +1254,7 @@ parse_option (input) ...@@ -1254,7 +1254,7 @@ parse_option (input)
for (; mn < (unsigned int) N_OPTS; mn++) for (; mn < (unsigned int) N_OPTS; mn++)
{ {
opt_len = cl_options[mn].opt_len; 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; break;
if (input[opt_len] == '\0') if (input[opt_len] == '\0')
return mn; return mn;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment