]> arthur.barton.de Git - netatalk.git/commitdiff
fix some 'Bjoern, think before you commit stupid code' issues.
authorbfernhomberg <bfernhomberg>
Sun, 25 Jan 2004 11:52:14 +0000 (11:52 +0000)
committerbfernhomberg <bfernhomberg>
Sun, 25 Jan 2004 11:52:14 +0000 (11:52 +0000)
etc/afpd/afp_config.c
etc/afpd/afp_options.c

index 2a2911c374910684b4342eff5b45e1208a13de37..6d0c7e16930a19b261ed020436d4cc2481902a64 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_config.c,v 1.22.6.3 2004-01-23 14:00:15 bfernhomberg Exp $
+ * $Id: afp_config.c,v 1.22.6.4 2004-01-25 11:52:33 bfernhomberg Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved.  See COPYRIGHT.
@@ -389,7 +389,7 @@ static AFPConfig *DSIConfigInit(const struct afp_options *options,
        /* If specified use the FQDN to register with srvloc, otherwise use IP. */
        p = NULL;
        if (options->fqdn) {
-           hostname = strdup(options->fqdn);
+           hostname = options->fqdn;
            p = strchr(hostname, ':');
        }       
        else 
index f75085d110002fa79d1490d4ecf6092899235319..6c13c1deb6919f4b2588d19fd74c7f5c37dfe8bc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_options.c,v 1.30.2.2.2.5 2004-01-24 18:05:26 bfernhomberg Exp $
+ * $Id: afp_options.c,v 1.30.2.2.2.6 2004-01-25 11:52:14 bfernhomberg Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -481,8 +481,8 @@ int afp_options_parseline(char *buf, struct afp_options *options)
             LOG(log_warning, logtype_afpd, "setting Unix codepage to '%s' failed", c);
        }
        else {
-            if (opt = strdup(c))
-                options->unixcodepage = strdup(c);
+            if ((opt = strdup(c)))
+                options->unixcodepage = opt;
        }
     }
        
@@ -492,8 +492,8 @@ int afp_options_parseline(char *buf, struct afp_options *options)
             LOG(log_warning, logtype_afpd, "setting Mac codepage to '%s' failed", c);
        }
        else {
-            if (opt = strdup(c))
-                options->maccodepage = strdup(c);
+            if ((opt = strdup(c)))
+                options->maccodepage = opt;
        }
     }