diff options
Diffstat (limited to 'iup/src/iup_layout.c')
-rwxr-xr-x | iup/src/iup_layout.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/iup/src/iup_layout.c b/iup/src/iup_layout.c index 0ccd496..9387135 100755 --- a/iup/src/iup_layout.c +++ b/iup/src/iup_layout.c @@ -143,8 +143,8 @@ void iupLayoutSetMinMaxSize(Ihandle* ih, int *w, int *h) char* value = iupAttribGet(ih, "MINSIZE"); int min_w = 0, min_h = 0; /* MINSIZE default value */ iupStrToIntInt(value, &min_w, &min_h, 'x'); - if (*w < min_w) *w = min_w; - if (*h < min_h) *h = min_h; + if (w && *w < min_w) *w = min_w; + if (h && *h < min_h) *h = min_h; } if (ih->has_maxsize) @@ -152,8 +152,8 @@ void iupLayoutSetMinMaxSize(Ihandle* ih, int *w, int *h) char* value = iupAttribGet(ih, "MAXSIZE"); int max_w = 65535, max_h = 65535; /* MAXSIZE default value */ iupStrToIntInt(value, &max_w, &max_h, 'x'); - if (*w > max_w) *w = max_w; - if (*h > max_h) *h = max_h; + if (w && *w > max_w) *w = max_w; + if (h && *h > max_h) *h = max_h; } } |