diff --git a/src/users.c b/src/users.c index 52f4d25..2490e29 100644 --- a/src/users.c +++ b/src/users.c @@ -3,8 +3,11 @@ #include Noh_String hash_password(Noh_Arena *temp, Noh_String_View username, Noh_String_View password) { + noh_arena_save(temp); + // Build the sha input string. Noh_String input = {0}; + input.arena = temp; noh_string_append_sv(&input, username); noh_string_append_cstr(&input, "<><>"); noh_string_append_sv(&input, password); @@ -17,7 +20,6 @@ Noh_String hash_password(Noh_Arena *temp, Noh_String_View username, Noh_String_V sha256_final(&ctx, hash); // Build the result string. - noh_arena_save(temp); Noh_String result = {0}; for (int i = 0; i < 32; i++) { noh_string_append_cstr(&result, noh_arena_sprintf(temp, "%02x", hash[i]));