gcc7: format-truncation fix for lua

pull/2926/head
Victor Julien 8 years ago
parent 0179514576
commit 020d9abb0e

@ -757,7 +757,11 @@ static OutputCtx *OutputLuaLogInitSub(ConfNode *conf, OutputCtx *parent_ctx)
}
char path[PATH_MAX] = "";
snprintf(path, sizeof(path),"%s%s%s", dir, strlen(dir) ? "/" : "", conf->val);
int ret = snprintf(path, sizeof(path),"%s%s%s", dir, strlen(dir) ? "/" : "", conf->val);
if (ret < 0 || ret == sizeof(path)) {
SCLogError(SC_ERR_SPRINTF,"failed to construct lua script path");
goto error;
}
SCLogDebug("script full path %s", path);
SCMutexLock(&lua_ctx->m);

Loading…
Cancel
Save