OSDN Git Service

Avoid using PATH_MAX constant.
authorresver <resver@60bc1c72-a15a-11de-b98f-4500b42dc123>
Fri, 11 Jan 2013 07:31:16 +0000 (07:31 +0000)
committerresver <resver@60bc1c72-a15a-11de-b98f-4500b42dc123>
Fri, 11 Jan 2013 07:31:16 +0000 (07:31 +0000)
git-svn-id: http://exfat.googlecode.com/svn/trunk@330 60bc1c72-a15a-11de-b98f-4500b42dc123

fuse/main.c

index d77f2df..bfb5e65 100644 (file)
@@ -340,15 +340,17 @@ static char* add_option(char* options, const char* name, const char* value)
 
 static char* add_fsname_option(char* options, const char* spec)
 {
-       char spec_abs[PATH_MAX];
+       char* spec_abs = realpath(spec, NULL);
 
-       if (realpath(spec, spec_abs) == NULL)
+       if (spec_abs == NULL)
        {
                free(options);
                exfat_error("failed to get absolute path for `%s'", spec);
                return NULL;
        }
-       return add_option(options, "fsname", spec_abs);
+       options = add_option(options, "fsname", spec_abs);
+       free(spec_abs);
+       return options;
 }
 
 static char* add_user_option(char* options)