On Fri, Jan 23, 2015 at 10:53:07AM +0800, Wang Nan wrote: SNIP
> >> SNIP > >> > >>> > >>> +/* If dup < 0, add a prefix. Else, add _dupl_X suffix. */ > >>> +static char *change_name(char *name, char *orig_name, int dup) > >>> +{ > >>> + char *new_name = NULL; > >>> + size_t len; > >>> + > >>> + if (!name) > >>> + name = orig_name; > >>> + > >>> + if (dup >= 10) > >>> + goto out; > >>> + > >>> + if (dup < 0) > >>> + len = strlen(name) + sizeof("_"); > >>> + else > >>> + len = strlen(orig_name) + sizeof("_dupl_X"); > >> > >> if we allow for _dupl_10, should we use 'sizeof("_dupl_x")' ^^^ in here? > >> > > We don't allow _dupl_10. If dup is 10 or larger (see above two if clause), > this function will > return NULL. ouch right.. ok ;-) thanks, jirka -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/