June 12, 2017
10:41 p.m.
On 2017-06-12 15:10, Christos Zoulas wrote:
On Jun 12, 11:21am, eggert@cs.ucla.edu (Paul Eggert) wrote: -- Subject: Re: [tz] defensive value for define on Solaris causes load of tim
| return EINVAL; | if (sizeof lsp->fullname - 1 <=3D strlen(p) + strlen(name)) | return ENAMETOOLONG; | - strcpy(fullname, p); | - strcat(fullname, "/"); | - strcat(fullname, name); | + strcpy(lsp->fullname, p); | + strcat(lsp->fullname, "/"); | + strcat(lsp->fullname, name);
Why not:
snprintf(lsp->fullname, sizeof(lsp_fullname), "%s/%s", p, name);
and remove more code... From another post today: /* ** We avoid using snprintf since it's not available on all systems. */
-- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada