Modernize string handling in BandwidthController

This change is preparation for removal of xt_quota2 in favor of NFLOG.
Note that the scope of changes is mostly limited to mechanical single
line changes from "const char*" to "const std::string&".

Test: as follows
    - built
    - flashed
    - booted
    - "runtest -x .../netd_unit_test.cpp" passes
    - "runtest -x .../netd_integration_test.cpp" passes
Bug: 38143143
Bug: 28362720

Change-Id: I56ba810ff6fa2f409e32d86508cfdb1a81a50a4e
diff --git a/server/NetdConstants.cpp b/server/NetdConstants.cpp
index 0d87264..0a0ca5d 100644
--- a/server/NetdConstants.cpp
+++ b/server/NetdConstants.cpp
@@ -140,10 +140,9 @@
  * Check an interface name for plausibility. This should e.g. help against
  * directory traversal.
  */
-bool isIfaceName(const char *name) {
+bool isIfaceName(const std::string& name) {
     size_t i;
-    size_t name_len = strlen(name);
-    if ((name_len == 0) || (name_len > IFNAMSIZ)) {
+    if ((name.empty()) || (name.size() > IFNAMSIZ)) {
         return false;
     }
 
@@ -152,7 +151,7 @@
         return false;
     }
 
-    for (i = 1; i < name_len; i++) {
+    for (i = 1; i < name.size(); i++) {
         if (!isalnum(name[i]) && (name[i] != '_') && (name[i] != '-') && (name[i] != ':')) {
             return false;
         }