changeset 745:525e5fec558a

avoid warning about uninitialized variables
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Fri, 09 Jan 2009 14:09:05 +0100
parents 8a91eba79e74
children 01af11519375
files src/html.cc
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/html.cc	Fri Jan 09 13:47:51 2009 +0100
+++ b/src/html.cc	Fri Jan 09 14:09:05 2009 +0100
@@ -1928,7 +1928,8 @@
    DilloImage *Image;
    char *width_ptr, *height_ptr, *alt_ptr;
    const char *attrbuf;
-   Length l_w, l_h;
+   Length l_w  = CSS_CREATE_LENGTH(0.0, CSS_LENGTH_TYPE_AUTO);
+   Length l_h  = CSS_CREATE_LENGTH(0.0, CSS_LENGTH_TYPE_AUTO);
    int space, border, w = 0, h = 0;
    bool load_now;
    CssPropertyList props;
@@ -1962,9 +1963,9 @@
       width_ptr = height_ptr = NULL;
       MSG("a_Html_add_new_image: suspicious image size request %dx%d\n", w, h);
    } else {
-      if (width_ptr)
+      if (CSS_LENGTH_TYPE(l_w) != CSS_LENGTH_TYPE_AUTO)
          props.set (CssProperty::CSS_PROPERTY_WIDTH, l_w);
-      if (height_ptr)
+      if (CSS_LENGTH_TYPE(l_h) != CSS_LENGTH_TYPE_AUTO)
          props.set (CssProperty::CSS_PROPERTY_HEIGHT, l_h);
    }