]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix uninit var in widget.c
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 16 Apr 2019 03:53:13 +0000 (20:53 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 16 Apr 2019 03:53:36 +0000 (20:53 -0700)
* src/widget.c (EmacsFrameQueryGeometry):
Avoid use of uninitialized variables ok_width, ok_height (Bug#35277).

src/widget.c

index 508974dd46ff67b048dafdb52ea1e079cf683a87..e662dd3ecdfc023cb49a838a8e6005798ac2e402 100644 (file)
@@ -434,21 +434,20 @@ EmacsFrameResize (Widget widget)
 }
 
 static XtGeometryResult
-EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *result)
+EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request,
+                        XtWidgetGeometry *result)
 {
-  EmacsFrame ew = (EmacsFrame) widget;
-
   int mask = request->request_mode;
-  Dimension ok_width, ok_height;
 
-  if (mask & (CWWidth | CWHeight))
+  if (mask & (CWWidth | CWHeight) && !frame_resize_pixelwise)
     {
-      if (!frame_resize_pixelwise)
-       round_size_to_char (ew,
-                           (mask & CWWidth) ? request->width : ew->core.width,
-                           ((mask & CWHeight) ? request->height
-                            : ew->core.height),
-                           &ok_width, &ok_height);
+      EmacsFrame ew = (EmacsFrame) widget;
+      Dimension ok_width, ok_height;
+
+      round_size_to_char (ew,
+                         mask & CWWidth ? request->width : ew->core.width,
+                         mask & CWHeight ? request->height : ew->core.height,
+                         &ok_width, &ok_height);
       if ((mask & CWWidth) && (ok_width != request->width))
        {
          result->request_mode |= CWWidth;