fixed some issues due to the Arg->const char * transition
825b7c3e
2 file(s) · +10 −9
| 113 | 113 | ||
| 114 | 114 | static void |
|
| 115 | 115 | buttonpress(XEvent *e) { |
|
| 116 | - | static char arg[8]; |
|
| 117 | - | int i, x; |
|
| 116 | + | static char buf[32]; |
|
| 117 | + | unsigned int i, x; |
|
| 118 | 118 | Client *c; |
|
| 119 | 119 | XButtonPressedEvent *ev = &e->xbutton; |
|
| 120 | 120 | ||
| 121 | - | arg[0] = 0; |
|
| 121 | + | buf[0] = 0; |
|
| 122 | 122 | if(barwin == ev->window) { |
|
| 123 | 123 | x = 0; |
|
| 124 | 124 | for(i = 0; i < ntags; i++) { |
|
| 125 | 125 | x += textw(tags[i]); |
|
| 126 | 126 | if(ev->x < x) { |
|
| 127 | - | snprintf(arg, sizeof arg, "%d", i); |
|
| 127 | + | snprintf(buf, sizeof buf, "%d", i); |
|
| 128 | 128 | if(ev->button == Button1) { |
|
| 129 | 129 | if(ev->state & MODKEY) |
|
| 130 | - | tag(arg); |
|
| 130 | + | tag(buf); |
|
| 131 | 131 | else |
|
| 132 | - | view(arg); |
|
| 132 | + | view(buf); |
|
| 133 | 133 | } |
|
| 134 | 134 | else if(ev->button == Button3) { |
|
| 135 | 135 | if(ev->state & MODKEY) |
|
| 136 | - | toggletag(arg); |
|
| 136 | + | toggletag(buf); |
|
| 137 | 137 | else |
|
| 138 | - | toggleview(arg); |
|
| 138 | + | toggleview(buf); |
|
| 139 | 139 | } |
|
| 140 | 140 | return; |
|
| 141 | 141 | } |
|
| 143 | 143 | if(ev->x < x + blw) |
|
| 144 | 144 | switch(ev->button) { |
|
| 145 | 145 | case Button1: |
|
| 146 | - | setlayout("-1"); |
|
| 146 | + | setlayout(NULL); |
|
| 147 | 147 | break; |
|
| 148 | 148 | } |
|
| 149 | 149 | } |
|
| 2 | 2 | * See LICENSE file for license details. |
|
| 3 | 3 | */ |
|
| 4 | 4 | #include "dwm.h" |
|
| 5 | + | #include <stdlib.h> |
|
| 5 | 6 | ||
| 6 | 7 | unsigned int blw = 0; |
|
| 7 | 8 | Layout *lt = NULL; |