D'oh! Thanks to @rcpoison for pointing this out!
Github: #380
if (datadir != NULL)
{
- size_t datadir_len = strlen (datadir);
+ size_t datadir_len = strlen (datadir) + 1;
if (datadir_len >= buffer_size)
return (ENOMEM);
sstrncpy (buffer, datadir, buffer_size);
+ buffer[datadir_len - 1] = '/';
+ buffer[datadir_len] = 0;
+
buffer += datadir_len;
buffer_size -= datadir_len;
}
if (datadir != NULL)
{
- size_t datadir_len = strlen (datadir);
+ size_t datadir_len = strlen (datadir) + 1;
if (datadir_len >= buffer_size)
return (ENOMEM);
sstrncpy (buffer, datadir, buffer_size);
+ buffer[datadir_len - 1] = '/';
+ buffer[datadir_len] = 0;
+
buffer += datadir_len;
buffer_size -= datadir_len;
}