]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/str.h
In disappearing_sliver README.txt file, describing which commit revision fixes
[xonotic/netradiant.git] / libs / str.h
index 8cb8a716793b0c9c6c54bc96160152f2aa1d97cb..bf0cd5897e3db6c72985be3708326671f8fba0f0 100644 (file)
@@ -58,20 +58,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #define __StrDup Q_StrDup
 
-inline char* Q_StrDup(char* pStr)
-{
-  if (pStr == NULL)
-    pStr = "";
+inline char* Q_StrDup( char* _pStr ) {
+       const char* pStr = _pStr;
+       if ( pStr == NULL ) {           
+               pStr = "";
+       }
 
-  return strcpy(new char[strlen(pStr)+1], pStr); 
+       return strcpy( new char[ strlen( pStr ) + 1 ], pStr );
 }
 
-inline char* Q_StrDup(const char* pStr)
-{ 
-  if (pStr == NULL)
-    pStr = "";
+inline char* Q_StrDup( const char* pStr ) {
+       if ( pStr == NULL ) {
+               pStr = "";
+       }
 
-  return strcpy(new char[strlen(pStr)+1], pStr); 
+       return strcpy( new char[strlen(pStr)+1], pStr );
 }
 
 #if defined (__linux__) || defined (__APPLE__)
@@ -286,7 +287,6 @@ public:
     }
     else
     {
-      g_pStrWork = "";
       g_pStrWork = new char[1];
       g_pStrWork[0] = '\0';
     }
@@ -327,7 +327,6 @@ public:
     }
     else
     {
-      g_pStrWork = "";
       g_pStrWork = new char[1];
       g_pStrWork[0] = '\0';
     }