enigma-dev/enigma-dev — pull request #738 by sorlok (2014-06-03 23:48:25+00:00)
Title: Fix infinite loop due to size/unsigned mismatch.

So fun story. size_t is "long unsigned int" on Linux 64-bit. That meas casting it to an unsigned int can lead to an infinite loop when checking against string::npos (since the cast value will always be truncated).

This was the only instance I came across, but it causes games that use d3d_model_load() with GL1 on Linux to spin forever and thrash my system.