use std::string instead of raw string
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Tue Sep 02 15:17:54 2008 -0700 (17 months ago)
changeset 358753e2e87aebd0
parent 3586 692e616413a3
child 3588 ad0a36bfdb62
use std::string instead of raw string
src/devices/wifi/ssid.cc
src/devices/wifi/ssid.h
     1.1 --- a/src/devices/wifi/ssid.cc	Tue Sep 02 15:17:43 2008 -0700
     1.2 +++ b/src/devices/wifi/ssid.cc	Tue Sep 02 15:17:54 2008 -0700
     1.3 @@ -32,8 +32,10 @@
     1.4        m_ssid[i] = 0;
     1.5      }
     1.6  }
     1.7 -Ssid::Ssid (char const *ssid)
     1.8 +Ssid::Ssid (std::string s)
     1.9  {
    1.10 +  NS_ASSERT (s.size () < 32);
    1.11 +  const char *ssid = s.c_str ();
    1.12    uint8_t len = 0;
    1.13    while (*ssid != 0 && len < 32) 
    1.14      {
     2.1 --- a/src/devices/wifi/ssid.h	Tue Sep 02 15:17:43 2008 -0700
     2.2 +++ b/src/devices/wifi/ssid.h	Tue Sep 02 15:17:54 2008 -0700
     2.3 @@ -35,8 +35,7 @@
     2.4  public:
     2.5    // broadcast ssid
     2.6    Ssid ();
     2.7 -  /* 0-terminated string */
     2.8 -  Ssid (char const *ssid);
     2.9 +  Ssid (std::string s);
    2.10    Ssid (char const ssid[32], uint8_t length);
    2.11  
    2.12    bool IsEqual (Ssid const &o) const;