Fixed calculateUserDir() to prevent extra dir separator insertion in default case.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 02 Apr 2002 13:39:44 +0000
changeset 155 54fee85d9c26
parent 154 275ea00e7283
child 156 f45e26b5f398
Fixed calculateUserDir() to prevent extra dir separator insertion in default case.
physfs.c
--- a/physfs.c	Tue Apr 02 13:36:58 2002 +0000
+++ b/physfs.c	Tue Apr 02 13:39:44 2002 +0000
@@ -279,12 +279,12 @@
 
         str = (uname != NULL) ? uname : "default";
         retval = (char *) malloc(strlen(baseDir) + strlen(str) +
-                                 (strlen(dirsep) * 2) + 6);
+                                 strlen(dirsep) + 6);
 
         if (retval == NULL)
             __PHYSFS_setError(ERR_OUT_OF_MEMORY);
         else
-            sprintf(retval, "%s%susers%s%s", baseDir, dirsep, dirsep, str);
+            sprintf(retval, "%susers%s%s", baseDir, dirsep, str);
 
         if (uname != NULL)
             free((void *) uname);
@@ -398,7 +398,6 @@
     char *ptr;
 
     BAIL_IF_MACRO(initialized, ERR_IS_INITIALIZED, 0);
-    BAIL_IF_MACRO(argv0 == NULL, ERR_INVALID_ARGUMENT, 0);
     BAIL_IF_MACRO(!__PHYSFS_platformInit(), NULL, 0);
 
     BAIL_IF_MACRO(!initializeMutexes(), NULL, 0);