[Pkg-owncloud-commits] [ocsync] 18/29: Get rid of PATH_MAX, that is not available under FreeBSD.

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri Dec 13 14:26:35 UTC 2013


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository ocsync.

commit 2cbdb35aac15c699871b7df7f6ea4eb1f0940a81
Author: hefee <hefee at netzguerilla.net>
Date:   Wed Dec 11 14:31:05 2013 +0100

    Get rid of PATH_MAX, that is not available under FreeBSD.
---
 src/csync_misc.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/csync_misc.c b/src/csync_misc.c
index 96ab122..d018c3b 100644
--- a/src/csync_misc.c
+++ b/src/csync_misc.c
@@ -90,7 +90,6 @@ char *csync_get_local_username(void) {
 #endif /* NSS_BUFLEN_PASSWD */
 
 char *csync_get_user_home_dir(void) {
-    char home[PATH_MAX] = {0};
     const char *envp;
     struct passwd pwd;
     struct passwd *pwdbuf;
@@ -98,11 +97,8 @@ char *csync_get_user_home_dir(void) {
     int rc;
 
     envp = getenv("HOME");
-    if (envp != NULL) {
-        snprintf(home, sizeof(home), "%s", envp);
-        if (home[0] != '\0') {
-            return c_strdup(home);
-        }
+    if (envp != NULL && envp[0] != '\0') {
+        return c_strdup(envp);
     }
 
     /* Still nothing found, read the password file */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/ocsync.git



More information about the Pkg-owncloud-commits mailing list