diff --git a/zsnes/src/parsegen.cpp b/zsnes/src/parsegen.cpp index ea2b908b..8cb8a7e8 100644 --- a/zsnes/src/parsegen.cpp +++ b/zsnes/src/parsegen.cpp @@ -210,6 +210,15 @@ string hex_convert(string str) str.insert(h_pos-h_len+1, "0x"); } + for (size_t i = 0; i < str.size(); i++) + { + if ((!i || !isxdigit(str[i-1])) && (str[i] == '0') && (str[i+1] != 'x')) + { + str.erase(i, 1); + i--; + } + } + return(str); }