This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

safe sprintf

Hi,

Unfortunately it seems that Keil brings only the standard version of sprintf which ist not safe against Buffer Overflows.
So I am looking for a safe version (like snprintf from libsafe).

Can anybody give me a hint where to find sources or even better did anybody already write a snprintf and is willing to share his code with me?

Best regards,
Marcus

Parents
  • ok ok, you are right and there are independant implementations ^^.
    What I meant is that they simply contain lots of stuff for various other plattforms I do not need. I know its not the problem, most of the code will not be used if you do not define what you don't need, but I would have to clean it up anyway. And I also do not need most of the supported specifiers. %s, c, d, u are sufficient. No long, long long, precision or whatever. I just needed a small and simple code saving implementation.

Reply
  • ok ok, you are right and there are independant implementations ^^.
    What I meant is that they simply contain lots of stuff for various other plattforms I do not need. I know its not the problem, most of the code will not be used if you do not define what you don't need, but I would have to clean it up anyway. And I also do not need most of the supported specifiers. %s, c, d, u are sufficient. No long, long long, precision or whatever. I just needed a small and simple code saving implementation.

Children
No data