diff --git a/Source/Modules/guile.cxx b/Source/Modules/guile.cxx index c7e8fe7e4..0777b316f 100644 --- a/Source/Modules/guile.cxx +++ b/Source/Modules/guile.cxx @@ -280,7 +280,7 @@ public: // Make sure `prefix' ends in an underscore if (prefix) { const char *px = Char(prefix); - if (px[Len(prefix)] != '_') + if (px[Len(prefix) - 1] != '_') Printf(prefix, "_"); } diff --git a/Source/Modules/mzscheme.cxx b/Source/Modules/mzscheme.cxx index c2abd7ec4..e2f44deef 100644 --- a/Source/Modules/mzscheme.cxx +++ b/Source/Modules/mzscheme.cxx @@ -101,10 +101,9 @@ public: } // If a prefix has been specified make sure it ends in a '_' (not actually used!) - if (prefix) { const char *px = Char(prefix); - if (px[Len(prefix)] != '_') + if (px[Len(prefix) - 1] != '_') Printf(prefix, "_"); } else prefix = NewString("swig_"); diff --git a/Source/Modules/ocaml.cxx b/Source/Modules/ocaml.cxx index 9fc5e9c71..beac03237 100644 --- a/Source/Modules/ocaml.cxx +++ b/Source/Modules/ocaml.cxx @@ -130,10 +130,9 @@ public: } // If a prefix has been specified make sure it ends in a '_' (not actually used!) - if (prefix) { const char *px = Char(prefix); - if (px[Len(prefix)] != '_') + if (px[Len(prefix) - 1] != '_') Printf(prefix, "_"); } else prefix = NewString("swig_");