I recently compiled the code in Dev-C++. Execution was fine up until EmptyLinkedList(list); which causes the error "ip2na.exe has encountered a problem and needs to close. We are sorry for the inconvenience... blah blah blah" Removing the call to EmptyLinkedList solves the problem, however this isn't really a solution. Anyway I have made two changes to the original code.
Firstly instead of prompting for an IP Address I have passed it as an argument and retrieved it from char** argv so on the command line you can do: ip2na w.x.y.z
Secondly when doing something like C:Documents and SettingsArran>G:ip2na.exe w.x.y.z it trys to open ip-to-country.txt in C:Documents and SettingsArran when its actually in G:. I have therefore added code to get the path of ip2na.exe from argv[0] and store it in char path[MAX_LENGTH] to which I strcat(path, "ip-to-country.txt").
One last thing, the size of ip-to-country.txt is quite large, one way of making it smaller would be storing the IP addresses as four bytes and not a string of digits. For example storing 33996344 as ASCII uses 8 bytes whereas it could be stored as 4 bytes as 2, 6, 190 and 56.
The modified source code can be found at http://websiteat.googlepages.com/ip2na.zip