]> arthur.barton.de Git - netatalk.git/blobdiff - etc/atalkd/config.c
Several small fixes, from Riccardo Magliocchetti
[netatalk.git] / etc / atalkd / config.c
index b456cc4ef1e7c40aa8b255b1ea35ee32486c9898..4005d6995631e8256608262dc457300a7623f5b5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: config.c,v 1.17 2009-10-13 22:55:37 didg Exp $
+ * $Id: config.c,v 1.20 2009-10-29 11:35:58 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -92,7 +92,7 @@ static const struct param {
 
 #define ARGV_CHUNK_SIZE 128
 #define MAXLINELEN 2048
-char **parseline(const char *line)
+static char **parseline(const char *line)
 {
     const char  *p;
     int                  argc = 0;
@@ -172,7 +172,7 @@ char **parseline(const char *line)
     return argv;
 }
 
-void freeline( char **argv )
+static void freeline( char **argv )
 {
     char **tmp = argv;
 
@@ -576,7 +576,7 @@ int net(struct interface *iface, char **av)
        return -1;
     }
 
-    if (( stop = strchr( nrange, '-' )) != 0 ) {
+    if (( stop = strchr( nrange, '-' )) != NULL ) {
        stop++;
     }
     net = atoi( nrange );
@@ -591,7 +591,7 @@ int net(struct interface *iface, char **av)
     }
 
     if ( iface->i_flags & IFACE_PHASE1 ) {
-       if ( stop != 0 ) {
+       if ( stop != NULL ) {
            fprintf( stderr, "Phase 1 doesn't use an address range.\n" );
            return -1;
        }
@@ -604,7 +604,7 @@ int net(struct interface *iface, char **av)
        iface->i_rt->rt_firstnet = iface->i_rt->rt_lastnet = htons( net );
     } else if ( iface->i_flags & IFACE_PHASE2 ) {
        iface->i_rt->rt_firstnet = htons( net );
-       if ( stop != 0 ) {
+       if ( stop != NULL ) {
            net = atoi( stop );
            if ( net < 0 || net >= 0xffff ) {
                fprintf( stderr, "Bad network: %d\n", net );
@@ -678,7 +678,7 @@ int zone(struct interface *iface, char **av)
     }
 
     /* codepage conversion */
-    if ((size_t)(-1) == convert_string_allocate(CH_UNIX, CH_MAC, av[0], strlen(av[0]), &zname)) {
+    if ((size_t)(-1) == convert_string_allocate(CH_UNIX, CH_MAC, av[0], -1, &zname)) {
        zname = strdup(av[0]);
     }
 
@@ -871,6 +871,8 @@ int plumb(void)
        }
 
        LOG(log_info, logtype_atalkd, "plumbed %s%d", device, ppa );
+
+    close(fd);
     }
 
     return( 0 );