procfs_doprocfile(): simplify

Now that proc_get_binpath() does not return NULL in fullpath on success,
directly use sbuf_cat() over the value.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
This commit is contained in:
Konstantin Belousov 2021-11-04 05:58:06 +02:00
parent 7ac82c96fe
commit 15bd9fa3be

View file

@ -77,7 +77,7 @@ procfs_doprocfile(PFS_FILL_ARGS)
PROC_LOCK(p);
error = proc_get_binpath(p, binpath, &fullpath, &freepath);
if (error == 0)
sbuf_printf(sb, "%s", fullpath == NULL ? "" : fullpath);
sbuf_cat(sb, fullpath);
free(binpath, M_TEMP);
free(freepath, M_TEMP);
return (error);