diff options
Diffstat (limited to 'FICS/comproc.c')
-rw-r--r-- | FICS/comproc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/FICS/comproc.c b/FICS/comproc.c index 39beb11..5314d58 100644 --- a/FICS/comproc.c +++ b/FICS/comproc.c @@ -666,6 +666,7 @@ who_verbose(int p, int num, int plist[]) char playerLine[255]; char tmp[255]; int p1; + int ret, too_long; pprintf(p, " +---------------------------------------------------------------+\n"); pprintf(p, " | User Standard Blitz On for Idle |\n"); @@ -708,7 +709,12 @@ who_verbose(int p, int num, int plist[]) psprintf_highlight(p, tmp + strlen(tmp), "%-17s", p1WithAttrs); } else { - sprintf(tmp, " %-17s", p1WithAttrs); + ret = snprintf(tmp, sizeof tmp, " %-17s", p1WithAttrs); + too_long = (ret < 0 || (size_t)ret >= sizeof tmp); + if (too_long) { + fprintf(stderr, "FICS: %s: warning: " + "snprintf truncated\n", __func__); + } } strcat(playerLine, tmp); |