June 13, 2017
5:51 a.m.
Why not:
snprintf(lsp->fullname, sizeof(lsp_fullname), "%s/%s", p, name);
and remove more code...
Just my 2 cents: looks well, but there are platforms (like MS Window/Visual Studio, see MSDN on snprintf :-() that do not guarantee termination of the string if a buffer is too small. To be bulletproof, add lsp->fullname[sizeof(lsp->fullname)-1]='\0'; Kees