changeset 3283:ef3a87ece392

Merged heads
author unexist
date Fri, 27 Apr 2018 11:48:17 +0200
parents eb240d50a4c0 (current diff) 51899d4db077 (diff)
children d2a85a993cb8
files
diffstat 2 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Rakefile	Fri Apr 27 11:46:33 2018 +0200
+++ b/Rakefile	Fri Apr 27 11:48:17 2018 +0200
@@ -64,7 +64,7 @@
   "hdrdir"     => "",
   "archdir"    => "",
   "revision"   => "3224", #< Latest stable
-  "cflags"     => "-Wall -Wpointer-arith -Wstrict-prototypes -Wunused -Wshadow -std=gnu99 " + (ENV["CFLAGS"] || ""),
+  "cflags"     => "-Wall -Wpointer-arith -Wstrict-prototypes -Wunused -Wshadow -Wformat -Wformat-security -std=gnu99 " + (ENV["CFLAGS"] || ""),
   "cpppath"    => "-I. -I$(builddir) -Isrc -Isrc/shared -Isrc/subtle -idirafter$(hdrdir) -idirafter$(archdir) " + (ENV["CPPFLAGS"] || ""),
   "ldflags"    => "$(rpath) -L$(libdir) $(LIBS) -l$(RUBY_SO_NAME) " + (ENV["LDFLAGS"] || ""),
   "extflags"   => "$(LDFLAGS) $(rpath) $(LIBS) -l$(RUBY_SO_NAME)",
@@ -284,7 +284,7 @@
 
     # Hardening
     if "yes" == @options["hardening"]
-      @options["cflags"] <<  " -fstack-protector-strong -Wformat -Wformat-security"
+      @options["cflags"] <<  " -fstack-protector-strong -D_FORTIFY_SOURCE=2"
     end
 
     # Get revision
--- a/src/shared/shared.c	Fri Apr 27 11:46:33 2018 +0200
+++ b/src/shared/shared.c	Fri Apr 27 11:48:17 2018 +0200
@@ -337,15 +337,18 @@
   XRectangle *geometry)
 {
   Window root = None;
-  unsigned int bw = 0, depth = 0;
-  XRectangle r = { 0 };
+  int x = 0, y = 0;
+  unsigned int width = 0, height = 0, bw = 0, depth = 0;
 
   assert(win && geometry);
 
-  XGetGeometry(disp, win, &root, (int *)&r.x, (int *)&r.y,
-    (unsigned int *)&r.width, (unsigned int *)&r.height, &bw, &depth);
+  XGetGeometry(disp, win, &root, &x, &y,
+    &width, &height, &bw, &depth);
 
-  *geometry = r;
+  geometry->x      = x;
+  geometry->y      = y;
+  geometry->width  = width;
+  geometry->height = height;
 } /* }}} */
 
  /** subSharedPropertyDelete {{{