Skip to content

Commit 1973b50

Browse files
UTIL: sss_parse_internal_fqname() optimization
Avoid unneeded strlen()'s
1 parent d599b8e commit 1973b50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/usertools.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ errno_t sss_parse_internal_fqname(TALLOC_CTX *mem_ctx,
629629
}
630630

631631
if (_shortname != NULL) {
632-
shortname_len = strlen(fqname) - strlen(separator);
632+
shortname_len = (size_t)(separator - fqname);
633633
*_shortname = talloc_strndup(mem_ctx, fqname, shortname_len);
634634
if (*_shortname == NULL) {
635635
return ENOMEM;

0 commit comments

Comments
 (0)