From: Karel Zak Date: Tue, 7 Oct 2025 10:12:05 +0000 (+0200) Subject: col: use snprintf() instead of sprintf() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=af2f3f99b90ded1481c80912744cd0a0dfa58d6b;p=thirdparty%2Futil-linux.git col: use snprintf() instead of sprintf() Signed-off-by: Karel Zak --- diff --git a/text-utils/col.c b/text-utils/col.c index 37654eae5..5866d7d0e 100644 --- a/text-utils/col.c +++ b/text-utils/col.c @@ -678,7 +678,7 @@ int main(int argc, char **argv) c = getchar(); if (c == EOF) break; - sprintf(buf, "\\x%02x", (unsigned char) c); + snprintf(buf, sizeof(buf), "\\x%02x", (unsigned char) c); len = strlen(buf); for (i = 0; i < len; i++) { lns.ch = buf[i];