On Wed, Aug 22, 2012 at 10:00 AM, Brandon Casey <drafnel@xxxxxxxxx> wrote: > Also, we have xstrndup. So I think the body of your function can become > something like: > > if (len && dir[len-1] == '/') > dir = tmp_dir = xstrndup(dir, len-1); > > retval = mkdir(dir, mode); > free(tmp_dir); Actually, xmemdupz could be used in place of xstrndup since we've already called strlen. -Brandon -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html