Quote:Original post by JohnBoltonI've just double checked with VC 2k3 and GCC, with interesting results.
Minor corrections: strncat does guarantee that the result is terminated. But like strncpy, snprintf does not guarantee that the result is terminated.
It appears that VC's strncat() does force termination while GCC's does not. On the other hand GCC's snprintf() does force termination while VC's _snprintf does not.
Could someone please triple check these findings? snprintf() hasn't been standardised long so I guess it's implementations could differ, however I have a hard time believing that someone would screw up their C89 standard library or even leave such issues implementation defined.
Lets hope I'm wrong, otherwise I'll have to go back and fix some code..