workspace->name = sstrdup(num);
/* We set ->num to the number if this workspace’s name consists only of
* a positive number. Otherwise it’s a named ws and num will be -1. */
- char *end;
- long parsed_num = strtol(num, &end, 10);
+
+ long parsed_num = strtol(num, NULL, 10);
if (parsed_num == LONG_MIN ||
parsed_num == LONG_MAX ||
- parsed_num < 0 ||
- (end && *end != '\0'))
+ parsed_num <= 0)
workspace->num = -1;
else workspace->num = parsed_num;
LOG("num = %d\n", workspace->num);
/* Set mouse pointer */
Con *new_output = con_get_output(focused);
if (old_output != new_output) {
- xcb_warp_pointer_rect(conn, &next->rect);
+ x_set_warp_to(&next->rect);
}
/* Update the EWMH hints */