diff --git a/src/shader.cpp b/src/shader.cpp index 4010789..5cb866f 100644 --- a/src/shader.cpp +++ b/src/shader.cpp @@ -43,10 +43,10 @@ addShaderProgram(MemoryArena* arena, const char* name) { LOGF(Info, "loading shader, %s\n", name); - // TODO: replace std::string w/ utilAllocCStr() ? - std::string hash_str = std::string(vs) + std::string(fs); const u32 max_len = 256; - u64 hash = utilFNV64a_str(hash_str.substr(0, max_len).c_str()); + char input_str[max_len]; + snprintf(input_str, max_len, "%s%s", vs, fs); + u64 hash = utilFNV64a_str(input_str); if (getShaderByHash(gl_ctx, hash)) { LOGF(Error, "shader is already loaded\n");