about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--client.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/client.c b/client.c
index 03d158f..64da343 100644
--- a/client.c
+++ b/client.c
@@ -365,16 +365,18 @@ updatetitle(Client *c) {
 		XGetWMName(dpy, c->win, &name);
 	if(!name.nitems)
 		return;
-	if(name.encoding == XA_STRING)
-		strncpy(c->name, (char *)name.value, sizeof c->name);
+	if(name.encoding == XA_STRING) {
+		strncpy(c->name, (char *)name.value, sizeof c->name - 1);
+	}
 	else {
 		if(XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success
 		&& n > 0 && *list)
 		{
-			strncpy(c->name, *list, sizeof c->name);
+			strncpy(c->name, *list, sizeof c->name - 1);
 			XFreeStringList(list);
 		}
 	}
+	c->name[sizeof c->name - 1] = '\0';
 	XFree(name.value);
 }
 
tion somewhat' href='/acidbong/suckless/dwm/commit/dwm.1?h=5.7&id=dc5c070c44d9af434405c8d6538abd06299d3298'>dc5c070 ^
e6cbe9c ^
0c3544d ^
dc5c070 ^



e6cbe9c ^
dc5c070 ^


e6cbe9c ^
e743836 ^
dc5c070 ^




901b3ed ^
1076f2b

901b3ed ^
0c3544d ^
2b35fae ^

a3e3f0b ^

2b35fae ^
3e06ede ^


292ccc4 ^
d4b7a9a ^
3e06ede ^


2b35fae ^
72655f0 ^

4bd0d33 ^
72655f0 ^


dbcf87c ^
72655f0 ^
72655f0 ^

3e06ede ^
72655f0 ^
3af6434 ^

3e06ede ^
3af6434 ^
72655f0 ^

3e06ede ^
72655f0 ^

3e06ede ^

72655f0 ^

7b5638f ^




dbcf87c ^
1549faf ^


3af6434 ^

3e06ede ^
1549faf ^
45aea23 ^



1549faf ^

dbcf87c ^
1549faf ^


3e06ede ^
1549faf ^
ba59bc8 ^
3e06ede ^


4bb89e2 ^

3e06ede ^
3af6434 ^
3e06ede ^

2b35fae ^
0c3544d ^
0e5c819 ^
4bd0d33 ^
0e5c819 ^
dbcf87c ^
0e5c819 ^
4bd0d33 ^






0e5c819 ^
4bd0d33 ^
0e5c819 ^
dbcf87c ^
0c3544d ^

dc5c070 ^

4bb89e2 ^

3e06ede ^
4bb89e2 ^




3e06ede ^
5ef6ef1 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140