There is definitely something wrong with the 'Limit size in extensions' validation test in C (most people who have encountered this are using C)
Only use the last '.' - strrchr()
No extension is UNKNOWN.
None of the test cases have an extension longer than 10, but I still only hash at most 10 characters.
Then I tried 9 characters to account for the null terminator.
Then I tried 5 characters for fun.
The only way I could see validating this is to give:
file.verylongextension1 and file.verylongextension2
then both map to the mime-type associated with extension 'verylongex'
Which my program will do.
I wondered if they tried to register verylongextension1 and verylongextension2 to different mime-types? Which would cause an ambiguous case. Do we return the first association, the second, neither, both? My guess is the second because that's how most built in hash maps work (which C does not have).
Nope. that didn't work either...
Why would you not provide a test for this validation case? Or allow us to see the validation?
Still 95% - moving on from this busted puzzle.