diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index a5539be4c436f0701c82c5ba08c39d84befdccd4..3f46b791a5ce022f268542446eb47292e2a1a03a 100644
--- a/libavformat/tcp.c
+++ b/libavformat/tcp.c
@@ -33,11 +33,11 @@ int resolve_host(struct in_addr *sin_addr, const char *hostname)
 {
     struct hostent *hp;
 
-    if ((inet_aton(hostname, sin_addr)) == 0) {
+    if (!inet_aton(hostname, sin_addr)) {
         hp = gethostbyname(hostname);
         if (!hp)
             return -1;
-        memcpy (sin_addr, hp->h_addr, sizeof(struct in_addr));
+        memcpy(sin_addr, hp->h_addr, sizeof(struct in_addr));
     }
     return 0;
 }