]> git.sesse.net Git - vlc/blobdiff - src/network/acl.c
Removes trailing spaces. Removes tabs.
[vlc] / src / network / acl.c
index 5b165c5ea4639ddf0cfac052a9972fb6c4a931bc..00f73dd170466ef6575678c7f8a5caef50bd8a12 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * acl.c:
  *****************************************************************************
- * Copyright (C) 2005 Rémi Denis-Courmont
+ * Copyright © 2005-2007 Rémi Denis-Courmont
  * $Id$
  *
  * Authors: Rémi Denis-Courmont <rem # videolan.org>
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
 #include <vlc/vlc.h>
 
+#include <ctype.h>
 #include <vlc_acl.h>
 
 #include <errno.h>
@@ -289,9 +287,6 @@ void ACL_Destroy( vlc_acl_t *p_acl )
     }
 }
 
-#ifndef isblank 
-#   define isblank(c) ((c) == ' ' || (c) == '\t')
-#endif
 
 /**
  * Reads ACL entries from a file.
@@ -346,12 +341,14 @@ int ACL_LoadFile( vlc_acl_t *p_acl, const char *psz_path )
                       psz_path);
             do
             {
-                fgets( line, sizeof( line ), file );
-                if( ferror( file ) || feof( file ) )
+                if( fgets( line, sizeof( line ), file ) == NULL )
                 {
-                    msg_Err( p_acl->p_owner, "error reading %s : %s\n",
-                             psz_path, strerror( errno ) );
-                    goto error;
+                     if( ferror( file ) )
+                     {
+                         msg_Err( p_acl->p_owner, "error reading %s : %s\n",
+                                  psz_path, strerror( errno ) );
+                     }
+                     goto error;
                 }
             }
             while( strchr( line, '\n' ) == NULL);
@@ -376,7 +373,7 @@ int ACL_LoadFile( vlc_acl_t *p_acl, const char *psz_path )
             *ptr++ = '\0'; /* separate address from mask length */
 
         if( (ptr != NULL)
-            ? ACL_AddNet( p_acl, psz_ip, atoi( ptr ), VLC_TRUE ) 
+            ? ACL_AddNet( p_acl, psz_ip, atoi( ptr ), VLC_TRUE )
             : ACL_AddHost( p_acl, psz_ip, VLC_TRUE ) )
         {
             msg_Err( p_acl->p_owner, "cannot add ACL from %s", psz_path );