about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--dwm.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/dwm.c b/dwm.c
index ae2952b..4ea16e0 100644
--- a/dwm.c
+++ b/dwm.c
@@ -24,6 +24,7 @@
  * To understand everything else, start reading main().
  */
 #include <errno.h>
+#include <locale.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -1046,7 +1047,6 @@ quit(const Arg *arg) {
 
 void
 resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
-	float a;
 	XWindowChanges wc;
 
 	if(sizehints) {
@@ -1064,11 +1064,10 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
 
 		/* adjust for aspect limits */
 		if(c->mina > 0 && c->maxa > 0) {
-			a = (float) w/h;
-			if(a > c->maxa)
+			if(c->maxa < (float)(w / h))
 				w = h * c->maxa;
-			else if(a < c->mina)
-				h = w / c->mina;
+			else if(c->mina < (float)(h / w))
+				h = w * c->mina;
 		}
 
 		if(baseismin) { /* increment calculation requires this */
@@ -1712,7 +1711,7 @@ main(int argc, char *argv[]) {
 	else if(argc != 1)
 		die("usage: dwm [-v]\n");
 
-	if(!XSupportsLocale())
+	if(!setlocale(LC_CTYPE, "") || !XSupportsLocale())
 		fprintf(stderr, "warning: no locale support\n");
 
 	if(!(dpy = XOpenDisplay(0)))
author Michael Vetter <jubalh@iodoru.org> 2019-05-03 10:26:48 +0200 committer Michael Vetter <jubalh@iodoru.org> 2019-05-03 10:26:48 +0200 Replace profanity URL in README' href='/danisanti/profani-tty/commit/README.md?id=187a2a07cd0bc642ec125b6177a91bbff5ca8f41'>187a2a07 ^
7e976a02 ^
187a2a07 ^
5709f5a2 ^



187a2a07 ^
4484c2b0 ^
543f0dea ^
c4d3f19d ^
447d19aa ^

d4892b29 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23