ah i love C. how do you read a line of text from a text file portably? fuck you, that's how
@eniko not sure if it fits your needs, but if the file is a file, my policy is almost always to read the entire thing into memory and then split it by lines if that's how i wanted it formatted
@eniko and when i say "split it by lines" i usually mean make a bunch of { char *, length } strings that point into that one buffer without malloc'ing the individual lines, but again - depends on use case ^^
@eniko also not sure if you wanted a solution or were just talking shit about C - my bad if the latter!!
@transmutrix it's just that this was for fonts and I figured I'd keep it human readable by making it a text file and then it was very annoying to parse and I probably should've just used binary
@eniko ahhh ok I getcha. well, for that small amount of text i would definitely recommend just fread'ing the whole file and then parsing inside that continuous block. if you're using modern C, you could skip it even and define fonts with object literals (if that works for you / your team's needs)
@transmutrix @eniko I bet that got exciting if there were nuls in the file
@stark @eniko If you store a length with your strings it doesn't matter if there are nulls in the file ^_^