Introduce sstrndup wrapper.

This commit is contained in:
Michael Hofmann
2015-05-06 16:28:29 +02:00
parent 37bee99538
commit 0319bda1d4
4 changed files with 16 additions and 2 deletions

View File

@ -106,7 +106,7 @@ static int workspaces_string_cb(void *params_, const unsigned char *val, size_t
if (!strcmp(params->cur_key, "name")) {
const char *ws_name = (const char *)val;
params->workspaces_walk->canonical_name = strndup(ws_name, len);
params->workspaces_walk->canonical_name = sstrndup(ws_name, len);
if (config.strip_ws_numbers && params->workspaces_walk->num >= 0) {
/* Special case: strip off the workspace number */