Fix 'occurred' typo
[libi2ncommon] / src / insocketstream.hxx
index 6405647..053e481 100644 (file)
@@ -39,7 +39,7 @@ on this file might be covered by the GNU General Public License.
 
 #include "exception.hxx"
 
-// ATTENTION: A lot of mysterious STL bugs occured
+// ATTENTION: A lot of mysterious STL bugs occurred
 //            with a "real" buffer (buffer larger than 1 byte and up to 100 bytes)
 //            -> Keep it slow and working!
 
@@ -63,7 +63,7 @@ class insocketstream : public std::streambuf
          struct sockaddr_un server_adr;
          server_adr.sun_family=AF_UNIX;
          strncpy(server_adr.sun_path,unixsocket.c_str(),sizeof(server_adr.sun_path));
-         server_adr.sun_path[sizeof(server_adr.sun_path)]=0;
+         server_adr.sun_path[sizeof(server_adr.sun_path)-1]=0;
          
          if(connect(sock,(struct sockaddr *) &server_adr, sizeof(server_adr)))
          {