]> git.sesse.net Git - vlc/blobdiff - src/network/acl.c
Removes trailing spaces. Removes tabs.
[vlc] / src / network / acl.c
index 69e97e7e591c2a3ee182ebeab43ac1832ed25fa1..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 "vlc_acl.h"
+#include <ctype.h>
+#include <vlc_acl.h>
 
 #include <errno.h>
 
-#include "network.h"
-#include "charset.h"
+#include <vlc_network.h>
+#include <vlc_charset.h>
 
 /* FIXME: rwlock on acl, but libvlc doesn't implement rwlock */
 typedef struct vlc_acl_entry_t
@@ -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 );