• Tom Lane's avatar
    Adjust comments about avoiding use of printf's %.*s. · ed437e2b
    Tom Lane authored
    My initial impression that glibc was measuring the precision in characters
    (which is what the Linux man page says it does) was incorrect.  It does take
    the precision to be in bytes, but it also tries to truncate the string at a
    character boundary.  The bottom line remains the same: it will mess up
    if the string is not in the encoding it expects, so we need to avoid %.*s
    anytime there's a significant risk of that.  Previous code changes are still
    good, but adjust the comments to reflect this knowledge.  Per research by
    Hernan Gonzalez.
    ed437e2b
scansup.c 4.91 KB