2 ms·
> that platform doesn't have an snprintf (yay mainframes!) One trick I did once when I wrote code somewhere that didn't have snprintf: create a pipe, fprintf i
by asveikau 13y ago
> that platform doesn't have an snprintf (yay mainframes!)
One trick I did once when I wrote code somewhere that didn't have snprintf: create a pipe, fprintf into it, and only read at most N bytes back.
It worked and was portable but I'm sure the performance was horrible; this wasn't anything professional, I was just messing around as a kid (back when it was more common to come across platforms that hadn't gotten to SUSv2 or C99 yet). Probably a better solution would be to steal an implementation from an open source libc.
- asveikau 13y agoNot sure why that was downvoted. I'm sorry I offended you, downvoter, but in my defense I've seen much more inane comments not downvoted here.