]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/utils.cpp
Fixed small alignment issues
[wxWidgets.git] / src / os2 / utils.cpp
index 14d2c6b3e19d13da73d22591ecb62aea4485490f..5a03ba30f3070e1c6d2aba8f569a2a59d4d04a37 100644 (file)
@@ -93,13 +93,12 @@ bool wxGetHostName( wxChar* zBuf, int nMaxSize )
                                 ,(void*)zBuf
                                 ,(ULONG)nMaxSize - 1
                                );
+        zBuf[nMaxSize] = _T('\0');
     }
     else
     {
-        wxStrncpy(zBuf, zSysname, nMaxSize - 1);
+        wxStrlcpy(zBuf, zSysname, nMaxSize);
     }
-
-    zBuf[nMaxSize] = _T('\0');
 #endif
 
     return *zBuf ? true : false;
@@ -121,7 +120,7 @@ bool wxGetUserName( wxChar* zBuf, int nMaxSize )
 #ifdef USE_NET_API
     wxGetUserId( zBuf, nMaxSize );
 #else
-    wxStrncpy(zBuf, _T("Unknown User"), nMaxSize);
+    wxStrlcpy(zBuf, _T("Unknown User"), nMaxSize);
 #endif
     return true;
 }