+ /* Calculate the length of the number str in the name */
+ size_t offset = strspn(ws_name, ws_num);
+
+ /* Also strip off the conventional ws name delimiter */
+ if (offset && ws_name[offset] == ':')
+ offset += 1;
+
+ /* Offset may be equal to length, in which case display the number */
+ params->workspaces_walk->name = (offset < len
+ ? i3string_from_utf8_with_length(ws_name + offset, len - offset)
+ : i3string_from_utf8(ws_num));
+
+ } else {
+ /* Default case: just save the name */
+ params->workspaces_walk->name = i3string_from_utf8_with_length(ws_name, len);