[PATCH] Avoid using non-standard extension strcasestr()
Faidon Liambotis
paravoid at debian.org
Mon Jun 21 15:05:34 UTC 2010
It fails on Solaris. Since we're only interested in the string "AS",
replace it in-place with tolower().
---
src/rpslcheck/rpslcheck.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/rpslcheck/rpslcheck.cc b/src/rpslcheck/rpslcheck.cc
index b893900..1b14e9e 100644
--- a/src/rpslcheck/rpslcheck.cc
+++ b/src/rpslcheck/rpslcheck.cc
@@ -157,7 +157,7 @@ int main(int argc, char **argv, char **envp) {
while (opt_my_as || cin ) {
if (opt_my_as) {
// if the first two characters of the ASN are "as", then ignore them
- if (strcasestr(opt_my_as, "as") == opt_my_as)
+ if (tolower(opt_my_as[0]) == 'a' && tolower(opt_my_as[1]) == 's')
opt_my_as += 2;
const char *dot = strchr(opt_my_as,'.');
--
1.7.0
More information about the irrtoolset
mailing list