Fix 'occurred' typo
[libi2ncommon] / src / insocketstream.hxx
index cc5b29d..053e481 100644 (file)
@@ -1,9 +1,27 @@
+/*
+The software in this package is distributed under the GNU General
+Public License version 2 (with a special exception described below).
+
+A copy of GNU General Public License (GPL) is included in this distribution,
+in the file COPYING.GPL.
+
+As a special exception, if other files instantiate templates or use macros
+or inline functions from this file, or you compile this file and link it
+with other works to produce a work based on this file, this file
+does not by itself cause the resulting work to be covered
+by the GNU General Public License.
+
+However the source code for this file must still be made available
+in accordance with section (3) of the GNU General Public License.
+
+This exception does not invalidate any other reasons why a work based
+on this file might be covered by the GNU General Public License.
+*/
 /***************************************************************************
               insocketstream.hxx  -  C++ streambuffer wrapper 
                              -------------------
     begin                : Sun Nov 10 2002
     copyright            : (C) 2002 by Intra2net AG
-    email                : intranator@intra2net.com
  ***************************************************************************/
 
 #ifndef _INSOCKETSTREAM
@@ -13,6 +31,7 @@
 #include <sstream>
 #include <streambuf>
 #include <stdio.h>
+#include <errno.h>
 
 #include <sys/socket.h>
 #include <sys/un.h>
@@ -20,7 +39,7 @@
 
 #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!
 
@@ -44,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)))
          {