![]() ![]() When we look at the man page of this function from the GNU project, we don't see any mention of the fact that NULL can't be pushed into it. In this case, they will go into iconv_open before the check. The code below illustrates that null pointers can be passed to the input in the tocode and fromcode arguments. With that out of the way, let's look at the neighborhood. Return (SDL_iconv_t)((uintptr_t)iconv_open(tocode, fromcode)) But there's a custom SDL_iconv_open implementation here!" That's an excellent observation! Here's how the function is implemented:įile: SDL/src/stdlib/SDL_iconv.c ( GitHub ) SDL_iconv_t SDL_iconv_open(const char *tocode, const char *fromcode) ![]() "I might have answered," the attentive and keen reader may object, "if we were dealing with the standard iconv_open function. * See if we can recover here (fixes iconv on Solaris 11) */ How much, dear reader, do you trust the documentation of the standard C library? Although a more appropriate question for our opening example would be: how much do you trust yourself when you use one? What do you think is wrong with the following example?įile: SDL/src/stdlib/SDL_iconv.c ( GitHub ) char *SDL_iconv_string(const char *tocode, const char *fromcode, Moreover, this time we decided to experiment a bit and take a little interview with the project creator, which we invite you, dear reader, to find at the end of the article.Īll right, enough wasting time, go-go-go! ![]() So, why don't we take this great chance to learn something new? Let's take a flashlight and look under the hood of the project! The project has been around for decades - its original creator and the community are still actively developing it. Neverwinter Nights, Dwarf Fortress, Amnesia, VVVVVV (on which we have a similar article), and the great and powerful Teeworlds (where Yours Truly spent a considerable amount of time hoockin' and bazookin' around) are among the games that use SDL in one way or another. If you've ever needed to initialize OpenGL, you've definitely encountered SDL.Īnd if you haven't, we highly recommend that you learn about it! SDL is a cross-platform library for graphics, audio, inputs, and everything else you need to finally create your game! ![]() If you've ever wanted to learn how to draw things on your screen for free (no viruses), you've probably come across SDL. If you've ever wanted to develop your own game, you've probably come across SDL. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |