Add warning in a "can't happen" case
authorBenjamin Otte <otte@gnome.org>
Mon, 17 Aug 2009 17:29:17 +0000 (19:29 +0200)
committerBenjamin Otte <otte@gnome.org>
Thu, 20 Aug 2009 18:07:53 +0000 (20:07 +0200)
This is mostly to indicate that we did not forget error checking.

libsoup/soup-address.c

index 043bac2..0aa0547 100644 (file)
@@ -566,7 +566,11 @@ update_addrs (SoupAddress *addr, GList *addrs, GError *error)
 
        len = g_socket_address_get_native_size (gsa);
        priv->sockaddr = g_malloc (len);
-       g_socket_address_to_native (gsa, priv->sockaddr, len, NULL);
+       if (!g_socket_address_to_native (gsa, priv->sockaddr, len, NULL)) {
+                /* can't happen: We know the address format is supported
+                 * and the buffer is large enough */
+                g_warn_if_reached ();
+        }
 
        return SOUP_STATUS_OK;
 }